From 8b6d07cb8583a9bf7bef176da942bd469ea88485 Mon Sep 17 00:00:00 2001 From: maedhros Date: Wed, 21 Feb 2007 23:18:08 +0000 Subject: (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. --- src/newgrf.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/newgrf.cpp') 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 */ -- cgit v1.2.3-54-g00ecf