diff --git a/src/lang/english.txt b/src/lang/english.txt index c1d7aeff7a..5655fd3bf2 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -5043,8 +5043,8 @@ STR_TOWN_DIRECTORY_TOWN_COLOUR :{TOWN}{BLACK} ( STR_OLD_DEPOT_TRAINT_LENGTH :Old depot length format: {STRING2} STR_TOWN_DIRECTORY_CAPTION_EXTRA :{WHITE}Towns ({YELLOW}{COMMA}{WHITE} / {ORANGE}{COMMA}{WHITE}) STR_SMALLMAP_TOWN_LARGE :{TINY_FONT}{YELLOW}{TOWN} -STR_TOWN_VIEW_TOWN_CAPTION_EXTRA :{WHITE}{TOWN} [{COMMA}] -STR_TOWN_VIEW_CITY_CAPTION_EXTRA :{WHITE}{TOWN} (City) [{COMMA}] +STR_TOWN_VIEW_TOWN_CAPTION_EXTRA :{WHITE}{TOWN} {COMMA} [{COMMA}] +STR_TOWN_VIEW_CITY_CAPTION_EXTRA :{WHITE}{TOWN} (City) {COMMA} [{COMMA}] STR_ORDER_DIST :{NUM}, {NUM} diff --git a/src/saveload/town_sl.cpp b/src/saveload/town_sl.cpp index 4837b6319f..859f6f870f 100644 --- a/src/saveload/town_sl.cpp +++ b/src/saveload/town_sl.cpp @@ -30,6 +30,7 @@ void RebuildTownCaches() FOR_ALL_TOWNS(town) { town->cache.population = 0; town->cache.num_houses = 0; + town->cache.potential_pop = 0; } for (TileIndex t = 0; t < MapSize(); t++) { @@ -39,6 +40,7 @@ void RebuildTownCaches() town = Town::GetByTile(t); IncreaseBuildingCount(town, house_id); if (IsHouseCompleted(t)) town->cache.population += HouseSpec::Get(house_id)->population; + town->cache.potential_pop += HouseSpec::Get(house_id)->population; /* Increase the number of houses for every house, but only once. */ if (GetHouseNorthPart(house_id) == 0) town->cache.num_houses++; diff --git a/src/town.h b/src/town.h index a7b128def0..08942f4ef6 100644 --- a/src/town.h +++ b/src/town.h @@ -49,6 +49,7 @@ extern TownPool _town_pool; struct TownCache { uint32 num_houses; ///< Amount of houses uint32 population; ///< Current population of people + uint32 potential_pop; ///< Potential population (if all houses are finished) ViewportSign sign; ///< Location of name sign, UpdateVirtCoord updates this PartOfSubsidyByte part_of_subsidy; ///< Is this town a source/destination of a subsidy? uint32 squared_town_zone_radius[HZB_END]; ///< UpdateTownRadius updates this given the house count diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 93dc049a06..a14b1b1ab3 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -2487,6 +2487,7 @@ static bool BuildTownHouse(Town *t, TileIndex tile) /* build the house */ t->cache.num_houses++; + t->cache.potential_pop += hs->population; /* Special houses that there can be only one of. */ t->flags |= oneof; @@ -2578,6 +2579,7 @@ void ClearTownHouse(Town *t, TileIndex tile) } t->cache.num_houses--; + t->cache.potential_pop -= hs->population; /* Clear flags for houses that only may exist once/town. */ if (hs->building_flags & BUILDING_IS_CHURCH) { diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 04775401d2..f10c2f885a 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -354,7 +354,8 @@ public: { if (widget == WID_TV_CAPTION){ SetDParam(0, this->town->index); - SetDParam(1, this->town->ratings[_current_company]); + SetDParam(1, this->town->cache.potential_pop); + SetDParam(2, this->town->ratings[_current_company]); } if (widget == WID_TV_CB){ extern bool _novahost;