1
0
Fork 0

Fix #12968, d20df82: Added back ability to create unremovable houses

pull/13380/head
Michael Ostapenko 2024-10-11 02:31:43 +11:00 committed by rubidium42
parent 5b4c5632ba
commit c4494faf10
1 changed files with 11 additions and 4 deletions

View File

@ -728,10 +728,17 @@ static CommandCost ClearTile_Town(TileIndex tile, DoCommandFlag flags)
Town *t = Town::GetByTile(tile);
if (Company::IsValidID(_current_company)) {
if (rating > t->ratings[_current_company] && !(flags & DC_NO_TEST_TOWN_RATING) &&
!_cheats.magic_bulldozer.value && _settings_game.difficulty.town_council_tolerance != TOWN_COUNCIL_PERMISSIVE) {
SetDParam(0, t->index);
return CommandCost(STR_ERROR_LOCAL_AUTHORITY_REFUSES_TO_ALLOW_THIS);
if (!_cheats.magic_bulldozer.value && !(flags & DC_NO_TEST_TOWN_RATING)) {
/* NewGRFs can add indestructible houses. */
if (rating > RATING_MAXIMUM) {
SetDParam(0, t->index);
return CommandCost(CMD_ERROR);
}
/* If town authority controls removal, check the company's rating. */
if (rating > t->ratings[_current_company] && _settings_game.difficulty.town_council_tolerance != TOWN_COUNCIL_PERMISSIVE) {
SetDParam(0, t->index);
return CommandCost(STR_ERROR_LOCAL_AUTHORITY_REFUSES_TO_ALLOW_THIS);
}
}
}