diff --git a/src/lang/english.txt b/src/lang/english.txt index 54b4e2bccf..b3069af4b7 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -5019,7 +5019,7 @@ STR_LOCAL_AUTHORITY_COMPANY_RATING_NUM :{YELLOW}{COMPAN STR_TOWN_VIEW_GROWTH :{BLACK}GR: {ORANGE}{COMMA} {BLACK}Next: {ORANGE}{COMMA} {BLACK}RH: {ORANGE}{COMMA} {BLACK}Flag {ORANGE}{NUM} {BLACK}FB: {ORANGE}{NUM} {BLACK}month{P "" s} STR_TOWN_VIEW_GROWTH_TILES :{BLACK}HS: {ORANGE}{COMMA}(+{COMMA}) {BLACK}CS: {ORANGE}{COMMA}(+{COMMA}) {BLACK}HR: {ORANGE}{COMMA}(+{COMMA}) STR_TOWN_VIEW_REALPOP_RATE :{BLACK}Real Population: {YELLOW}{COMMA} {BLACK}Rating: {YELLOW}{COMMA} -STR_TOWN_VIEW_HOUSE_STATE :{BLACK}Houses: UC {ORANGE}{COMMA} {BLACK}UR: {ORANGE}{COMMA} {BLACK}DTM: {ORANGE}{COMMA} +STR_TOWN_VIEW_HOUSE_STATE :{BLACK}Houses: UC {ORANGE}{COMMA} {BLACK}RTM: {ORANGE}{COMMA} {BLACK}DTM: {ORANGE}{COMMA} STR_CB_DISTANCE_CHECK :CB town acceptance: {STRING2} ###ADMIN diff --git a/src/saveload/town_sl.cpp b/src/saveload/town_sl.cpp index b5d645bf3b..4404622049 100644 --- a/src/saveload/town_sl.cpp +++ b/src/saveload/town_sl.cpp @@ -45,9 +45,7 @@ void RebuildTownCaches() town = Town::GetByTile(t); IncreaseBuildingCount(town, house_id); if (IsHouseCompleted(t)) town->cache.population += HouseSpec::Get(house_id)->population; - else{ - town->houses_construction++; - } + else town->houses_construction++; town->cache.potential_pop += HouseSpec::Get(house_id)->population; /* Increase the number of houses for every house, but only once. */ diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index e966458f16..e288d48355 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -431,7 +431,7 @@ void UpdateAllTownVirtCoords() */ static void ChangePopulation(Town *t, int mod) { - if(mod > 0 && t->houses_construction > 0) t->houses_construction--; + // if(mod > 0 && t->houses_construction > 0) t->houses_construction--; t->cache.population += mod; InvalidateWindowData(WC_TOWN_VIEW, t->index); // Cargo requirements may appear/vanish for small populations @@ -471,8 +471,13 @@ static void MakeSingleHouseBigger(TileIndex tile) if (IsHouseCompleted(tile)) { /* Now that construction is complete, we can add the population of the * building to the town. */ - ChangePopulation(Town::GetByTile(tile), HouseSpec::Get(GetHouseType(tile))->population); + HouseID house_id = GetHouseType(tile); + Town *town = Town::GetByTile(tile); + const HouseSpec *hs = HouseSpec::Get(house_id); + ChangePopulation(town, hs->population); ResetHouseAge(tile); + if (hs->building_flags & BUILDING_HAS_1_TILE) + town->houses_construction--; } MarkTileDirtyByTile(tile); } @@ -571,13 +576,13 @@ static void TileLoop_Town(TileIndex tile) t->time_until_rebuild = GB(r, 16, 8) + 192; ClearTownHouse(t, tile); - t->houses_demolished++; /* Rebuild with another house? */ - if (GB(r, 24, 8) >= 12) { - if(BuildTownHouse(t, tile)) t->houses_reconstruction++; + if (GB(r, 24, 8) >= 12 && BuildTownHouse(t, tile)) { + t->houses_reconstruction++; UpdateTownGrowthTile(tile, TGTS_RH_REBUILT); } else { + t->houses_demolished++; UpdateTownGrowthTile(tile, TGTS_RH_REMOVED); } } @@ -2589,6 +2594,7 @@ static bool BuildTownHouse(Town *t, TileIndex tile) if (construction_stage == TOWN_HOUSE_COMPLETED) { ChangePopulation(t, hs->population); + t->houses_construction--; } else { construction_counter = GB(r, 2, 2); } @@ -2662,14 +2668,12 @@ void ClearTownHouse(Town *t, TileIndex tile) /* Remove population from the town if the house is finished. */ if (IsHouseCompleted(tile)) { ChangePopulation(t, -hs->population); - } - else{ - if(t->houses_construction > 0) t->houses_construction--; + } else { + t->houses_construction--; } t->cache.num_houses--; t->cache.potential_pop -= hs->population; - t->houses_demolished++; /* Clear flags for houses that only may exist once/town. */ if (hs->building_flags & BUILDING_IS_CHURCH) {