summaryrefslogtreecommitdiff
path: root/src/newgrf_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2008-08-20 19:31:35 +0000
committerfrosch <frosch@openttd.org>2008-08-20 19:31:35 +0000
commit7c5d2374478a01509ac2ebbfb7480b98c4f3221f (patch)
tree87429c357bea2a7f2ca3d1f30590cf4821ba67a8 /src/newgrf_gui.cpp
parentd43a475650b6ba0ff14d1d50345277b46643b59c (diff)
downloadopenttd-7c5d2374478a01509ac2ebbfb7480b98c4f3221f.tar.xz
(svn r14112) -Fix (r13715)[FS#2232]: Action B custom messages with parameteers were broken.
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r--src/newgrf_gui.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 907ade31d..a996d0521 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -53,23 +53,20 @@ static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint w, uint bott
if (c->error != NULL) {
char message[512];
- if (c->error->custom_message == NULL) {
- SetDParamStr(0, c->filename);
- SetDParamStr(1, c->error->data);
- for (uint i = 0; i < c->error->num_params; i++) {
- uint32 param = 0;
- byte param_number = c->error->param_number[i];
-
- if (param_number < c->num_params) param = c->param[param_number];
-
- SetDParam(2 + i, param);
- }
-
- GetString(message, c->error->message, lastof(message));
- } else {
- SetDParamStr(0, c->error->custom_message);
- GetString(message, STR_JUST_RAW_STRING, lastof(message));
+ SetDParamStr(0, c->error->custom_message); // is skipped by built-in messages
+ SetDParam (1, STR_JUST_RAW_STRING);
+ SetDParamStr(2, c->filename);
+ SetDParam (3, STR_JUST_RAW_STRING);
+ SetDParamStr(4, c->error->data);
+ for (uint i = 0; i < c->error->num_params; i++) {
+ uint32 param = 0;
+ byte param_number = c->error->param_number[i];
+
+ if (param_number < c->num_params) param = c->param[param_number];
+
+ SetDParam(5 + i, param);
}
+ GetString(message, c->error->custom_message == NULL ? c->error->message : STR_JUST_RAW_STRING, lastof(message));
SetDParamStr(0, message);
y += DrawStringMultiLine(x, y, c->error->severity, w, bottom - y);