(svn r8838) -Feature: Show newgrf error messages loaded in Action B in the newgrf gui

window. GRFs with an error have a warning symbol shown before the name.
This commit is contained in:
maedhros
2007-02-21 23:18:08 +00:00
parent fd4a0dafc2
commit f2d63dcecf
9 changed files with 25 additions and 4 deletions

View File

@@ -2712,7 +2712,14 @@ static void GRFError(byte *buf, int len)
return;
}
grfmsg(0, msgstr[(message_id == 0xFF) ? lengthof(msgstr) - 1 : message_id], sevstr[severity], grf_load_string(&buf, len));
char message[512];
snprintf(message, lengthof(message), msgstr[(message_id == 0xFF) ? lengthof(msgstr) - 1 : message_id], sevstr[severity], grf_load_string(&buf, len));
if (_cur_grfconfig->error == NULL) {
_cur_grfconfig->error = strdup(message);
}
grfmsg(0, message);
}
/* Action 0x0C */