(svn r23789) -Fix: [NewGRF] While we can only show one error per NewGRF, fatal errors should always disable the GRF. Also give those errors precedence over other information.

This commit is contained in:
frosch 2012-01-12 17:46:42 +00:00
parent ec54f39db5
commit 7b0ea17f00
1 changed files with 7 additions and 3 deletions

View File

@ -6128,9 +6128,6 @@ static void GRFLoadError(ByteReader *buf)
STR_NEWGRF_ERROR_MSG_FATAL
};
/* For now we can only show one message per newgrf file. */
if (_cur.grfconfig->error != NULL) return;
byte severity = buf->ReadByte();
byte lang = buf->ReadByte();
byte message_id = buf->ReadByte();
@ -6153,6 +6150,10 @@ static void GRFLoadError(ByteReader *buf)
/* This is a fatal error, so make sure the GRF is deactivated and no
* more of it gets loaded. */
DisableGrf();
/* Make sure we show fatal errors, instead of silly infos from before */
delete _cur.grfconfig->error;
_cur.grfconfig->error = NULL;
}
if (message_id >= lengthof(msgstr) && message_id != 0xFF) {
@ -6165,6 +6166,9 @@ static void GRFLoadError(ByteReader *buf)
return;
}
/* For now we can only show one message per newgrf file. */
if (_cur.grfconfig->error != NULL) return;
GRFError *error = new GRFError(sevstr[severity]);
if (message_id == 0xFF) {