mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-22 15:11:54 +00:00
(svn r11360) -Fix [FS#1375]: do not crash when trying to "draw" an invalid string, just draw a message saying it is invalid.
This commit is contained in:
parent
554d7d924a
commit
74691a4218
@ -116,12 +116,12 @@ static const char *GetStringPtr(StringID string)
|
|||||||
*/
|
*/
|
||||||
static char *GetStringWithArgs(char *buffr, uint string, const int64 *argv, const char* last)
|
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 index = GB(string, 0, 11);
|
||||||
uint tab = GB(string, 11, 5);
|
uint tab = GB(string, 11, 5);
|
||||||
char buff[512];
|
char buff[512];
|
||||||
|
|
||||||
if (GB(string, 0, 16) == 0) error("!invalid string id 0 in GetString");
|
|
||||||
|
|
||||||
switch (tab) {
|
switch (tab) {
|
||||||
case 4:
|
case 4:
|
||||||
if (index >= 0xC0)
|
if (index >= 0xC0)
|
||||||
|
Loading…
Reference in New Issue
Block a user