Add NewGRF object property for flood-resistance

Does not imply being able to be built on water
This commit is contained in:
Jonathan G Rennison
2021-12-05 21:32:57 +00:00
parent 06fa1ae332
commit 24fb390e9f
6 changed files with 11 additions and 1 deletions

View File

@@ -717,7 +717,7 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags)
/* Removing with the cheat costs more in TTDPatch / the specs. */
cost.MultiplyCost(25);
}
} else if ((spec->flags & (OBJECT_FLAG_BUILT_ON_WATER | OBJECT_FLAG_NOT_ON_LAND)) != 0) {
} else if ((spec->flags & (OBJECT_FLAG_BUILT_ON_WATER | OBJECT_FLAG_NOT_ON_LAND)) != 0 || (spec->ctrl_flags & OBJECT_CTRL_FLAG_FLOOD_RESISTANT) != 0) {
/* Water can't remove objects that are buildable on water. */
return CMD_ERROR;
}