Feature: Prevent towns from upgrading individually-placed houses (#13270)

This commit is contained in:
Tyler Trahan
2025-02-09 15:37:06 -05:00
committed by GitHub
parent 1ed685b5c1
commit 521b860394
13 changed files with 130 additions and 21 deletions

View File

@@ -1548,6 +1548,16 @@ bool AfterLoadGame()
}
}
if (IsSavegameVersionBefore(SLV_PROTECT_PLACED_HOUSES)) {
for (auto t : Map::Iterate()) {
if (IsTileType(t, MP_HOUSE)) {
/* We now store house protection status in the map. Set this based on the house spec flags. */
const HouseSpec *hs = HouseSpec::Get(GetHouseType(t));
SetHouseProtected(t, hs->extra_flags.Test(HouseExtraFlag::BuildingIsProtected));
}
}
}
/* Check and update house and town values */
UpdateHousesAndTowns();