station_cmd.c
changeset 5385 3868f2e6db9b
parent 5380 8ea58542b6e0
child 5395 7727da322d66
--- a/station_cmd.c	Wed Dec 27 12:22:25 2006 +0000
+++ b/station_cmd.c	Wed Dec 27 12:38:02 2006 +0000
@@ -4,6 +4,7 @@
 
 #include "stdafx.h"
 #include "openttd.h"
+#include "bridge_map.h"
 #include "debug.h"
 #include "functions.h"
 #include "station_map.h"
@@ -795,6 +796,10 @@
 	int flat_z;
 
 	BEGIN_TILE_LOOP(tile_cur, w, h, tile)
+		if (MayHaveBridgeAbove(tile_cur) && IsBridgeAbove(tile_cur)) {
+			return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
+		}
+
 		if (!EnsureNoVehicle(tile_cur)) return CMD_ERROR;
 
 		tileh = GetTileSlope(tile_cur, &z);