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/strings.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/strings.cpp')
-rw-r--r-- | src/strings.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/strings.cpp b/src/strings.cpp index ae72e2a25..36fe46dc8 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -668,7 +668,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg uint orig_offset = args->offset; /* When there is no array with types there is no need to do a dry run. */ - if (!args->HasTypeInformation()) dry_run = true; + if (!args->HasTypeInformation() && !UsingNewGRFTextStack()) dry_run = true; if (!dry_run) { if (UsingNewGRFTextStack()) { /* Values from the NewGRF text stack are only copied to the normal @@ -702,7 +702,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg if (SCC_NEWGRF_FIRST <= b && b <= SCC_NEWGRF_LAST) { /* We need to pass some stuff as it might be modified; oh boy. */ //todo: should argve be passed here too? - b = RemapNewGRFStringControlCode(b, buf_start, &buff, &str, (int64 *)args->GetDataPointer()); + b = RemapNewGRFStringControlCode(b, buf_start, &buff, &str, (int64 *)args->GetDataPointer(), dry_run); if (b == 0) continue; } |