summaryrefslogtreecommitdiff
path: root/src/newgrf_gui.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2020-05-17 23:31:54 +0200
committerMichael Lutz <michi@icosahedron.de>2020-05-21 20:02:34 +0200
commit9c2e47d03cbc4c7af416a34b09e0c8d0de7c3474 (patch)
treeb1120b42d5021788628550e5792c27cc8deb5dc7 /src/newgrf_gui.cpp
parentc082f570cebd237c35de9caa08fcc84a9c44e95d (diff)
downloadopenttd-9c2e47d03cbc4c7af416a34b09e0c8d0de7c3474.tar.xz
Codechange: Use std::string for storing GRF error messages.
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r--src/newgrf_gui.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 3b462f427..3f0a2ee7e 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -50,10 +50,10 @@ void ShowNewGRFError()
/* We only want to show fatal errors */
if (c->error == nullptr || c->error->severity != STR_NEWGRF_ERROR_MSG_FATAL) continue;
- SetDParam (0, c->error->custom_message == nullptr ? c->error->message : STR_JUST_RAW_STRING);
- SetDParamStr(1, c->error->custom_message);
+ SetDParam (0, c->error->message != STR_NULL ? c->error->message : STR_JUST_RAW_STRING);
+ SetDParamStr(1, c->error->custom_message.c_str());
SetDParamStr(2, c->filename);
- SetDParamStr(3, c->error->data);
+ SetDParamStr(3, c->error->data.c_str());
for (uint i = 0; i < lengthof(c->error->param_value); i++) {
SetDParam(4 + i, c->error->param_value[i]);
}
@@ -66,13 +66,13 @@ static void ShowNewGRFInfo(const GRFConfig *c, uint x, uint y, uint right, uint
{
if (c->error != nullptr) {
char message[512];
- SetDParamStr(0, c->error->custom_message); // is skipped by built-in messages
+ SetDParamStr(0, c->error->custom_message.c_str()); // is skipped by built-in messages
SetDParamStr(1, c->filename);
- SetDParamStr(2, c->error->data);
+ SetDParamStr(2, c->error->data.c_str());
for (uint i = 0; i < lengthof(c->error->param_value); i++) {
SetDParam(3 + i, c->error->param_value[i]);
}
- GetString(message, c->error->custom_message == nullptr ? c->error->message : STR_JUST_RAW_STRING, lastof(message));
+ GetString(message, c->error->message != STR_NULL ? c->error->message : STR_JUST_RAW_STRING, lastof(message));
SetDParamStr(0, message);
y = DrawStringMultiLine(x, right, y, bottom, c->error->severity);