summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 0e10667e8..b9e110639 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -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) {