From 475fa465d7d793416520d1723012eafe73c721a8 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 6 Nov 2018 12:33:41 +0100 Subject: check that rectangle is in a single layer --- src/station_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 &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 affected_stations; -- cgit v1.2.3-70-g09d2