diff --git a/src/base_station_base.h b/src/base_station_base.h --- a/src/base_station_base.h +++ b/src/base_station_base.h @@ -54,7 +54,7 @@ struct BaseStation : StationPool::PoolIt 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::PoolIt 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(); }