Check that tile area is valid in CmdBuildRailStation
This commit is contained in:
@@ -1333,6 +1333,9 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32
|
|||||||
w_org = numtracks;
|
w_org = numtracks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check if the first tile and the last tile are valid */
|
||||||
|
if (!IsValidTile(tile_org) || TileAddWrap(tile_org, w_org - 1, h_org - 1) == INVALID_TILE) return CMD_ERROR;
|
||||||
|
|
||||||
bool reuse = (station_to_join != NEW_STATION);
|
bool reuse = (station_to_join != NEW_STATION);
|
||||||
if (!reuse) station_to_join = INVALID_STATION;
|
if (!reuse) station_to_join = INVALID_STATION;
|
||||||
bool distant_join = (station_to_join != INVALID_STATION);
|
bool distant_join = (station_to_join != INVALID_STATION);
|
||||||
|
Reference in New Issue
Block a user