Merge branch 'master' into jgrpp
# Conflicts: # src/base_station_base.h # src/industry.h # src/industry_cmd.cpp # src/industry_gui.cpp # src/lang/korean.txt # src/os/macosx/crashlog_osx.cpp # src/station_cmd.cpp # src/town.h # src/town_cmd.cpp # src/town_gui.cpp
This commit is contained in:
@@ -62,7 +62,7 @@ struct Industry : IndustryPool::PoolItem<&_industry_pool> {
|
||||
|
||||
PartOfSubsidy part_of_subsidy; ///< NOSAVE: is this industry a source/destination of a subsidy?
|
||||
StationList stations_near; ///< NOSAVE: List of nearby stations.
|
||||
std::unique_ptr<const char, FreeDeleter> cached_name; ///< NOSAVE: Cache of the resolved name of the industry
|
||||
mutable std::string cached_name; ///< NOSAVE: Cache of the resolved name of the industry
|
||||
|
||||
Owner founder; ///< Founder of the industry
|
||||
Date construction_date; ///< Date of the construction of the industry
|
||||
@@ -160,12 +160,12 @@ struct Industry : IndustryPool::PoolItem<&_industry_pool> {
|
||||
|
||||
inline const char *GetCachedName() const
|
||||
{
|
||||
if (!this->cached_name) const_cast<Industry *>(this)->FillCachedName();
|
||||
return this->cached_name.get();
|
||||
if (this->cached_name.empty()) this->FillCachedName();
|
||||
return this->cached_name.c_str();
|
||||
}
|
||||
|
||||
private:
|
||||
void FillCachedName();
|
||||
void FillCachedName() const;
|
||||
|
||||
protected:
|
||||
static uint16 counts[NUM_INDUSTRYTYPES]; ///< Number of industries per type ingame
|
||||
|
Reference in New Issue
Block a user