diff options
author | rubidium <rubidium@openttd.org> | 2007-10-30 18:32:26 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-10-30 18:32:26 +0000 |
commit | 74691a4218bf5d7305107cd308ed9cb0682f9233 (patch) | |
tree | 7465ca179c74caad6fdc6d313a5bdd7a57993c77 | |
parent | 554d7d924a97ddbdd2aab09179d918d2a60c17fc (diff) | |
download | openttd-74691a4218bf5d7305107cd308ed9cb0682f9233.tar.xz |
(svn r11360) -Fix [FS#1375]: do not crash when trying to "draw" an invalid string, just draw a message saying it is invalid.
-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 393f45f11..8db726215 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -116,12 +116,12 @@ static const char *GetStringPtr(StringID string) */ static char *GetStringWithArgs(char *buffr, uint string, const int64 *argv, const char* last) { + if (GB(string, 0, 16) == 0) return GetStringWithArgs(buffr, STR_UNDEFINED, argv, last); + uint index = GB(string, 0, 11); uint tab = GB(string, 11, 5); char buff[512]; - if (GB(string, 0, 16) == 0) error("!invalid string id 0 in GetString"); - switch (tab) { case 4: if (index >= 0xC0) |