mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r12304) -Codechange: use IsValidTile() where it should be used
This commit is contained in:
parent
35195bb2bc
commit
86a4d377b1
@ -399,7 +399,7 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint32
|
|||||||
CommandProc *proc;
|
CommandProc *proc;
|
||||||
|
|
||||||
/* Do not even think about executing out-of-bounds tile-commands */
|
/* Do not even think about executing out-of-bounds tile-commands */
|
||||||
if (tile >= MapSize() || IsTileType(tile, MP_VOID)) {
|
if (!IsValidTile(tile)) {
|
||||||
_cmd_text = NULL;
|
_cmd_text = NULL;
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
}
|
}
|
||||||
@ -499,7 +499,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
|
|||||||
int y = TileY(tile) * TILE_SIZE;
|
int y = TileY(tile) * TILE_SIZE;
|
||||||
|
|
||||||
/* Do not even think about executing out-of-bounds tile-commands */
|
/* Do not even think about executing out-of-bounds tile-commands */
|
||||||
if (tile >= MapSize() || IsTileType(tile, MP_VOID)) {
|
if (!IsValidTile(tile)) {
|
||||||
_cmd_text = NULL;
|
_cmd_text = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user