summaryrefslogtreecommitdiff
path: root/disaster_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'disaster_cmd.c')
-rw-r--r--disaster_cmd.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/disaster_cmd.c b/disaster_cmd.c
index 0c28ddc0a..16c0a523d 100644
--- a/disaster_cmd.c
+++ b/disaster_cmd.c
@@ -13,25 +13,31 @@
#include "airport_movement.h"
#include "sound.h"
-static void DisasterClearSquare(uint tile)
+static void DisasterClearSquare(TileIndex tile)
{
- int type;
-
if (!EnsureNoVehicle(tile))
return;
- type = TileType(tile);
+ switch (TileType(tile)) {
+ case MP_RAILWAY:
+ if (IS_HUMAN_PLAYER(_map_owner[tile])) DoClearSquare(tile);
+ break;
+
+ case MP_HOUSE: {
+ byte p = _current_player;
+ _current_player = OWNER_NONE;
+ DoCommandByTile(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
+ _current_player = p;
+ break;
+ }
- if (type == MP_RAILWAY) {
- if (IS_HUMAN_PLAYER(_map_owner[tile]))
+ case MP_TREES:
+ case MP_CLEAR:
DoClearSquare(tile);
- } else if (type == MP_HOUSE) {
- byte p = _current_player;
- _current_player = OWNER_NONE;
- DoCommandByTile(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
- _current_player = p;
- } else if (type == MP_TREES || type == MP_CLEAR) {
- DoClearSquare(tile);
+ break;
+
+ default:
+ break;
}
}