diff options
author | yexo <yexo@openttd.org> | 2011-10-12 19:25:52 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2011-10-12 19:25:52 +0000 |
commit | bac8ce6b41c5c0886a83ce3e94801d28c2269851 (patch) | |
tree | d2a7e94f8583d8dacca2f110e76419c65553eb69 /src/newgrf_text.cpp | |
parent | 560b527f6f32d5dcfe17217d442e07397ed35808 (diff) | |
download | openttd-bac8ce6b41c5c0886a83ce3e94801d28c2269851.tar.xz |
(svn r23027) -Fix: in some cases NewGRF string arguments were popped twice from the newgrf textstack
Diffstat (limited to 'src/newgrf_text.cpp')
-rw-r--r-- | src/newgrf_text.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index 711d68d15..a5f598360 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -1020,11 +1020,12 @@ void RewindTextRefStack() * @param buff the buffer we're writing to * @param str the string that we need to write * @param argv the OpenTTD stack of values + * @param modify_argv When true, modify the OpenTTD stack. * @return the string control code to "execute" now */ -uint RemapNewGRFStringControlCode(uint scc, char *buf_start, char **buff, const char **str, int64 *argv) +uint RemapNewGRFStringControlCode(uint scc, char *buf_start, char **buff, const char **str, int64 *argv, bool modify_argv) { - if (_newgrf_textrefstack.used) { + if (_newgrf_textrefstack.used && modify_argv) { switch (scc) { default: NOT_REACHED(); case SCC_NEWGRF_PRINT_BYTE_SIGNED: *argv = _newgrf_textrefstack.PopSignedByte(); break; |