diff options
author | maedhros <maedhros@openttd.org> | 2007-02-21 23:18:08 +0000 |
---|---|---|
committer | maedhros <maedhros@openttd.org> | 2007-02-21 23:18:08 +0000 |
commit | 8b6d07cb8583a9bf7bef176da942bd469ea88485 (patch) | |
tree | d603c0685ec921601a4cde5803bfbc4c046c69a3 /src/newgrf.cpp | |
parent | a2ecc3cc645b61e2ca2087c8b92995bd9bf51c30 (diff) | |
download | openttd-8b6d07cb8583a9bf7bef176da942bd469ea88485.tar.xz |
(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.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 1c0aed0e9..9ddc095eb 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -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 */ |