Merge real population from cmbase

This commit is contained in:
dP
2020-06-20 01:36:12 +03:00
12 changed files with 84 additions and 65 deletions

View File

@@ -2865,7 +2865,6 @@ 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;
@@ -2959,12 +2958,12 @@ void ClearTownHouse(Town *t, TileIndex tile)
const HouseSpec *hs = HouseSpec::Get(house);
/* Remove population from the town if the house is finished. */
if (IsHouseCompleted(tile)) {
bool is_completed = IsHouseCompleted(tile);
if (is_completed) {
ChangePopulation(t, -hs->population);
}
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) {
@@ -2986,6 +2985,8 @@ void ClearTownHouse(Town *t, TileIndex tile)
/* Update cargo acceptance. */
UpdateTownCargoes(t, tile);
citymania::Emit(citymania::event::HouseCleared{t, tile, hs, is_completed});
}
/**