summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;