changeset 17971:6d9c38e89c48 draft

(svn r22780) -Fix: [NewGRF] String codes 84 and 87 print signed values.
author frosch <frosch@openttd.org>
date Sat, 20 Aug 2011 23:16:49 +0000
parents 9e32495c89f0
children d9623e963863
files src/newgrf_text.cpp src/table/control_codes.h
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/newgrf_text.cpp
+++ b/src/newgrf_text.cpp
@@ -1014,7 +1014,6 @@
 		switch (scc) {
 			default: NOT_REACHED();
 			case SCC_NEWGRF_PRINT_BYTE_SIGNED:      *argv = _newgrf_textrefstack.PopSignedByte();    break;
-			case SCC_NEWGRF_PRINT_WORD_SIGNED:      *argv = _newgrf_textrefstack.PopSignedWord();    break;
 			case SCC_NEWGRF_PRINT_QWORD_CURRENCY:   *argv = _newgrf_textrefstack.PopSignedQWord();   break;
 
 			case SCC_NEWGRF_PRINT_DWORD_CURRENCY:
@@ -1023,9 +1022,11 @@
 			case SCC_NEWGRF_PRINT_BYTE_HEX:         *argv = _newgrf_textrefstack.PopUnsignedByte();  break;
 			case SCC_NEWGRF_PRINT_QWORD_HEX:        *argv = _newgrf_textrefstack.PopUnsignedQWord(); break;
 
-			case SCC_NEWGRF_PRINT_WORD_HEX:
 			case SCC_NEWGRF_PRINT_WORD_SPEED:
 			case SCC_NEWGRF_PRINT_WORD_VOLUME:
+			case SCC_NEWGRF_PRINT_WORD_SIGNED:      *argv = _newgrf_textrefstack.PopSignedWord();    break;
+
+			case SCC_NEWGRF_PRINT_WORD_HEX:
 			case SCC_NEWGRF_PRINT_WORD_WEIGHT:
 			case SCC_NEWGRF_PRINT_WORD_POWER:
 			case SCC_NEWGRF_PRINT_WORD_STATION_NAME:
--- a/src/table/control_codes.h
+++ b/src/table/control_codes.h
@@ -120,8 +120,8 @@
 	SCC_NEWGRF_PRINT_WORD_STRING_ID,                  ///< Read 2 bytes from the stack as String ID
 	SCC_NEWGRF_PRINT_WORD_DATE_LONG,                  ///< Read 2 bytes from the stack as base 1920 date
 	SCC_NEWGRF_PRINT_WORD_DATE_SHORT,                 ///< Read 2 bytes from the stack as base 1920 date
-	SCC_NEWGRF_PRINT_WORD_SPEED,                      ///< Read 2 bytes from the stack as unsigned speed
-	SCC_NEWGRF_PRINT_WORD_VOLUME,                     ///< Read 2 bytes from the stack as unsigned volume
+	SCC_NEWGRF_PRINT_WORD_SPEED,                      ///< Read 2 bytes from the stack as signed speed
+	SCC_NEWGRF_PRINT_WORD_VOLUME,                     ///< Read 2 bytes from the stack as signed volume
 	SCC_NEWGRF_PRINT_WORD_WEIGHT,                     ///< Read 2 bytes from the stack as unsigned weight
 	SCC_NEWGRF_PRINT_WORD_STATION_NAME,               ///< Read 2 bytes from the stack as station name
 	SCC_NEWGRF_PRINT_QWORD_CURRENCY,                  ///< Read 8 bytes from the stack as currency