Changeset - r22500:c8b85352121b
[Not reviewed]
master
0 1 0
frosch - 8 years ago 2016-12-23 22:13:38
frosch@openttd.org
(svn r27707) -Fix: Make the result of NewGRF's CARGO_NAME string code reliably print 'Nothing', if an invalid type is provided.
1 file changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/newgrf_text.cpp
Show inline comments
 
@@ -1062,10 +1062,12 @@ uint RemapNewGRFStringControlCode(uint s
 
				*argv = MapGRFStringID(_newgrf_textrefstack.grffile->grfid, _newgrf_textrefstack.PopUnsignedWord());
 
				break;
 

	
 
			case SCC_NEWGRF_PRINT_WORD_CARGO_NAME:
 
				*argv = 1 << GetCargoTranslation(_newgrf_textrefstack.PopUnsignedWord(), _newgrf_textrefstack.grffile);
 
			case SCC_NEWGRF_PRINT_WORD_CARGO_NAME: {
 
				CargoID cargo = GetCargoTranslation(_newgrf_textrefstack.PopUnsignedWord(), _newgrf_textrefstack.grffile);
 
				*argv = cargo < NUM_CARGO ? 1 << cargo : 0;
 
				break;
 
		}
 
		}
 
	} else {
 
		/* Consume additional parameter characters */
 
		switch (scc) {
0 comments (0 inline, 0 general)