diff --git a/src/command.cpp b/src/command.cpp index b372222939..bb519cbd37 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -399,7 +399,7 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32 CommandProc *proc; /* Do not even think about executing out-of-bounds tile-commands */ - if (tile >= MapSize() || IsTileType(tile, MP_VOID)) { + if (!IsValidTile(tile)) { _cmd_text = NULL; return CMD_ERROR; } @@ -499,7 +499,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, int y = TileY(tile) * TILE_SIZE; /* Do not even think about executing out-of-bounds tile-commands */ - if (tile >= MapSize() || IsTileType(tile, MP_VOID)) { + if (!IsValidTile(tile)) { _cmd_text = NULL; return false; }