diff options
author | frosch <frosch@openttd.org> | 2008-08-20 19:31:35 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-08-20 19:31:35 +0000 |
commit | 7c5d2374478a01509ac2ebbfb7480b98c4f3221f (patch) | |
tree | 87429c357bea2a7f2ca3d1f30590cf4821ba67a8 /src/newgrf_gui.cpp | |
parent | d43a475650b6ba0ff14d1d50345277b46643b59c (diff) | |
download | openttd-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.cpp | 29 |
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); |