summaryrefslogtreecommitdiff
path: root/src/base_station_base.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/base_station_base.h')
-rw-r--r--src/base_station_base.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/base_station_base.h b/src/base_station_base.h
index 0467866e5..40543f1b8 100644
--- a/src/base_station_base.h
+++ b/src/base_station_base.h
@@ -54,7 +54,7 @@ struct BaseStation : StationPool::PoolItem<&_station_pool> {
TrackedViewportSign sign; ///< NOSAVE: Dimensions of sign
byte delete_ctr; ///< Delete counter. If greater than 0 then it is decremented until it reaches 0; the waypoint is then is deleted.
- char *name; ///< Custom name
+ std::string name; ///< Custom name
StringID string_id; ///< Default name (town area) of station
mutable std::string cached_name; ///< NOSAVE: Cache of the resolved name of the station, if not using a custom name
@@ -111,7 +111,7 @@ struct BaseStation : StationPool::PoolItem<&_station_pool> {
inline const char *GetCachedName() const
{
- if (this->name != nullptr) return this->name;
+ if (!this->name.empty()) return this->name.c_str();
if (this->cached_name.empty()) this->FillCachedName();
return this->cached_name.c_str();
}