summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-07-08 18:40:15 +0000
committermaedhros <maedhros@openttd.org>2007-07-08 18:40:15 +0000
commitfc3764ef4bed671b470d95ea655f34243b163c47 (patch)
tree1ae20f12354e03d3a16c1f8e2efc220488f17e82 /src
parentc9ef554e0186b747f476f0805586c96f512bd600 (diff)
downloadopenttd-fc3764ef4bed671b470d95ea655f34243b163c47.tar.xz
(svn r10480) -Fix: Don't allow building lighthouses and transmitters under bridges in the scenario editor, or during world generation.
Diffstat (limited to 'src')
-rw-r--r--src/main_gui.cpp5
-rw-r--r--src/unmovable_cmd.cpp5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index 1113c66c3..22ecde8b7 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -31,6 +31,7 @@
#include "variables.h"
#include "train.h"
#include "roadveh.h"
+#include "bridge_map.h"
#include "unmovable_map.h"
#include "string.h"
#include "screenshot.h"
@@ -1137,7 +1138,7 @@ static void PlaceProc_RockyArea(TileIndex tile)
static void PlaceProc_LightHouse(TileIndex tile)
{
- if (!IsTileType(tile, MP_CLEAR) || IsSteepSlope(GetTileSlope(tile, NULL))) {
+ if (!IsTileType(tile, MP_CLEAR) || IsSteepSlope(GetTileSlope(tile, NULL)) || IsBridgeAbove(tile)) {
return;
}
@@ -1148,7 +1149,7 @@ static void PlaceProc_LightHouse(TileIndex tile)
static void PlaceProc_Transmitter(TileIndex tile)
{
- if (!IsTileType(tile, MP_CLEAR) || IsSteepSlope(GetTileSlope(tile, NULL))) {
+ if (!IsTileType(tile, MP_CLEAR) || IsSteepSlope(GetTileSlope(tile, NULL)) || IsBridgeAbove(tile)) {
return;
}
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));