diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -1062,9 +1062,11 @@ 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 */