summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubidium <rubidium@openttd.org>2021-07-10 10:14:05 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-07-10 10:51:00 +0200
commit1c0c4637d2d65194dcc10ab727a99ec74ea5d962 (patch)
treed25665eecfb88064eec6aa5cd1336431a4402573
parentede3f79475bc987a154783b874619c16d1aa643c (diff)
downloadopenttd-1c0c4637d2d65194dcc10ab727a99ec74ea5d962.tar.xz
Fix 11ab3c4: [NewGRF] Overflow when determining cargo mask for string code 9A 1E
9A 1E: Print unsigned word as name of a cargo type (translated for GRF version >= 7).
-rw-r--r--src/newgrf_text.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp
index 18a876a6a..6617365f9 100644
--- a/src/newgrf_text.cpp
+++ b/src/newgrf_text.cpp
@@ -949,7 +949,7 @@ uint RemapNewGRFStringControlCode(uint scc, char *buf_start, char **buff, const
case SCC_NEWGRF_PRINT_WORD_CARGO_NAME: {
CargoID cargo = GetCargoTranslation(_newgrf_textrefstack.PopUnsignedWord(), _newgrf_textrefstack.grffile);
- *argv = cargo < NUM_CARGO ? 1 << cargo : 0;
+ *argv = cargo < NUM_CARGO ? 1ULL << cargo : 0;
break;
}
}