summaryrefslogtreecommitdiff
path: root/src/town_gui.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2020-05-17 23:31:59 +0200
committerMichael Lutz <michi@icosahedron.de>2020-05-21 20:02:34 +0200
commit63ccb36ef3ecd53a503c0e9fea87f0784802af0f (patch)
treed3e1134029fd437d1ad2d948f83592b930e9456f /src/town_gui.cpp
parent9b6f5e3bb850b6cff02cc761767fcdf49c681645 (diff)
downloadopenttd-63ccb36ef3ecd53a503c0e9fea87f0784802af0f.tar.xz
Codechange: Use std::string for most of the user-settable custom names.
Diffstat (limited to 'src/town_gui.cpp')
-rw-r--r--src/town_gui.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index bc65322ba..38314f3fb 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -434,8 +434,8 @@ public:
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_LEFT, y += FONT_HEIGHT_NORMAL, STR_TOWN_VIEW_NOISE_IN_TOWN);
}
- if (this->town->text != nullptr) {
- SetDParamStr(0, this->town->text);
+ if (!this->town->text.empty()) {
+ SetDParamStr(0, this->town->text.c_str());
DrawStringMultiLine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y += FONT_HEIGHT_NORMAL, UINT16_MAX, STR_JUST_RAW_STRING, TC_BLACK);
}
}
@@ -516,8 +516,8 @@ public:
if (_settings_game.economy.station_noise_level) aimed_height += FONT_HEIGHT_NORMAL;
- if (this->town->text != nullptr) {
- SetDParamStr(0, this->town->text);
+ if (!this->town->text.empty()) {
+ SetDParamStr(0, this->town->text.c_str());
aimed_height += GetStringHeight(STR_JUST_RAW_STRING, width - WD_FRAMERECT_LEFT - WD_FRAMERECT_RIGHT);
}