mirror of https://github.com/OpenTTD/OpenTTD
Fix #12968, d20df82: Added back ability to create unremovable houses
parent
5b4c5632ba
commit
c4494faf10
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue