From fc3764ef4bed671b470d95ea655f34243b163c47 Mon Sep 17 00:00:00 2001 From: maedhros Date: Sun, 8 Jul 2007 18:40:15 +0000 Subject: (svn r10480) -Fix: Don't allow building lighthouses and transmitters under bridges in the scenario editor, or during world generation. --- src/unmovable_cmd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/unmovable_cmd.cpp') diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp index 747e24979..fcf00805b 100644 --- a/src/unmovable_cmd.cpp +++ b/src/unmovable_cmd.cpp @@ -18,6 +18,7 @@ #include "economy.h" #include "town.h" #include "sprite.h" +#include "bridge_map.h" #include "unmovable_map.h" #include "variables.h" #include "table/unmovable_land.h" @@ -358,7 +359,7 @@ void GenerateUnmovables() do { tile = RandomTile(); - if (IsTileType(tile, MP_CLEAR) && GetTileSlope(tile, &h) == SLOPE_FLAT && h >= TILE_HEIGHT * 4) { + if (IsTileType(tile, MP_CLEAR) && GetTileSlope(tile, &h) == SLOPE_FLAT && h >= TILE_HEIGHT * 4 && !IsBridgeAbove(tile)) { if (IsRadioTowerNearby(tile)) continue; MakeTransmitter(tile); IncreaseGeneratingWorldProgress(GWP_UNMOVABLE); @@ -401,7 +402,7 @@ restart: do { if (--j == 0) goto restart; tile = TILE_MASK(tile + TileOffsByDiagDir(dir)); - } while (!(IsTileType(tile, MP_CLEAR) && GetTileSlope(tile, &h) == SLOPE_FLAT && h <= TILE_HEIGHT * 2)); + } while (!(IsTileType(tile, MP_CLEAR) && GetTileSlope(tile, &h) == SLOPE_FLAT && h <= TILE_HEIGHT * 2 && !IsBridgeAbove(tile))); assert(tile == TILE_MASK(tile)); -- cgit v1.2.3-54-g00ecf