Changeset - r21588:937e75283c6b
[Not reviewed]
master
0 1 0
frosch - 10 years ago 2014-08-03 11:59:07
frosch@openttd.org
(svn r26713) -Fix (r23027): [NewGRF] Parameters to SCC_NEWGRF_PUSH_WORD and SCC_NEWGRF_UNPRINT were not skipped during drawing.
1 file changed with 10 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/newgrf_text.cpp
Show inline comments
 
@@ -1039,48 +1039,58 @@ uint RemapNewGRFStringControlCode(uint s
 
			case SCC_NEWGRF_PRINT_DWORD_DATE_LONG:
 
			case SCC_NEWGRF_PRINT_DWORD_DATE_SHORT:
 
			case SCC_NEWGRF_PRINT_DWORD_HEX:        *argv = _newgrf_textrefstack.PopUnsignedDWord(); break;
 

	
 
			case SCC_NEWGRF_PRINT_WORD_DATE_LONG:
 
			case SCC_NEWGRF_PRINT_WORD_DATE_SHORT:  *argv = _newgrf_textrefstack.PopUnsignedWord() + DAYS_TILL_ORIGINAL_BASE_YEAR; break;
 

	
 
			case SCC_NEWGRF_DISCARD_WORD:           _newgrf_textrefstack.PopUnsignedWord(); break;
 

	
 
			case SCC_NEWGRF_ROTATE_TOP_4_WORDS:     _newgrf_textrefstack.RotateTop4Words(); break;
 
			case SCC_NEWGRF_PUSH_WORD:              _newgrf_textrefstack.PushWord(Utf8Consume(str)); break;
 
			case SCC_NEWGRF_UNPRINT:                *buff = max(*buff - Utf8Consume(str), buf_start); break;
 

	
 
			case SCC_NEWGRF_PRINT_WORD_CARGO_LONG:
 
			case SCC_NEWGRF_PRINT_WORD_CARGO_SHORT:
 
			case SCC_NEWGRF_PRINT_WORD_CARGO_TINY:
 
				argv[0] = GetCargoTranslation(_newgrf_textrefstack.PopUnsignedWord(), _newgrf_textrefstack.grffile);
 
				argv[1] = _newgrf_textrefstack.PopUnsignedWord();
 
				break;
 

	
 
			case SCC_NEWGRF_PRINT_WORD_STRING_ID:
 
				*argv = MapGRFStringID(_newgrf_textrefstack.grffile->grfid, _newgrf_textrefstack.PopUnsignedWord());
 
				break;
 
		}
 
	} else {
 
		/* Consume additional parameter characters */
 
		switch (scc) {
 
			default: break;
 

	
 
			case SCC_NEWGRF_PUSH_WORD:
 
			case SCC_NEWGRF_UNPRINT:
 
				Utf8Consume(str);
 
				break;
 
		}
 
	}
 

	
 
	switch (scc) {
 
		default: NOT_REACHED();
 
		case SCC_NEWGRF_PRINT_DWORD_SIGNED:
 
		case SCC_NEWGRF_PRINT_WORD_SIGNED:
 
		case SCC_NEWGRF_PRINT_BYTE_SIGNED:
 
		case SCC_NEWGRF_PRINT_WORD_UNSIGNED:
 
			return SCC_COMMA;
 

	
 
		case SCC_NEWGRF_PRINT_BYTE_HEX:
 
		case SCC_NEWGRF_PRINT_WORD_HEX:
 
		case SCC_NEWGRF_PRINT_DWORD_HEX:
 
		case SCC_NEWGRF_PRINT_QWORD_HEX:
 
			return SCC_HEX;
 

	
 
		case SCC_NEWGRF_PRINT_DWORD_CURRENCY:
 
		case SCC_NEWGRF_PRINT_QWORD_CURRENCY:
 
			return SCC_CURRENCY_LONG;
 

	
 
		case SCC_NEWGRF_PRINT_WORD_STRING_ID:
 
			return SCC_NEWGRF_PRINT_WORD_STRING_ID;
 

	
 
		case SCC_NEWGRF_PRINT_WORD_DATE_LONG:
0 comments (0 inline, 0 general)