(svn r14057) -Fix: NewGRF text stack's "push word" didn't move the data around properly (minime)
authorrubidium
Tue, 12 Aug 2008 22:12:14 +0000
changeset 9907 4233d2e96ffc
parent 9906 9c0a829bf58e
child 9908 a2cd9bc6a38b
(svn r14057) -Fix: NewGRF text stack's "push word" didn't move the data around properly (minime)
src/newgrf_text.cpp
--- a/src/newgrf_text.cpp	Tue Aug 12 20:49:27 2008 +0000
+++ b/src/newgrf_text.cpp	Tue Aug 12 22:12:14 2008 +0000
@@ -544,8 +544,8 @@
 		if (this->position >= 2) {
 			this->position -= 2;
 		} else {
-			for (uint i = lengthof(stack) - 3; i >= this->position; i--) {
-				this->stack[this->position + 2] = this->stack[this->position];
+			for (int i = lengthof(stack) - 1; i >= this->position + 2; i--) {
+				this->stack[i] = this->stack[i - 2];
 			}
 		}
 		this->stack[this->position]     = GB(word, 0, 8);