summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-11-06 12:33:41 +0100
committerErich Eckner <git@eckner.net>2018-11-16 19:11:47 +0100
commit475fa465d7d793416520d1723012eafe73c721a8 (patch)
tree70ca6c23d16515c642d618ac85baad1c5c68837a
parent28bef186d5c42c8d6acec87973fc6a2aa8919850 (diff)
downloadopenttd-475fa465d7d793416520d1723012eafe73c721a8.tar.xz
check that rectangle is in a single layer
-rw-r--r--src/station_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 5e3f6c04b..d3ea5b7ec 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1593,7 +1593,7 @@ CommandCost RemoveFromRailBaseStation(TileArea ta, SmallVector<T *, 4> &affected
CommandCost CmdRemoveFromRailStation(TileIndex start, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{
TileIndex end = p1 == 0 ? start : p1;
- if (start >= MapSize() || end >= MapSize()) return CMD_ERROR;
+ if (start >= MapSize() || end >= MapSize() || (LayerIndex(start) != LayerIndex(end))) return CMD_ERROR;
TileArea ta(start, end);
SmallVector<Station *, 4> affected_stations;