Changeset - r7202:73a0810e750e
[Not reviewed]
master
0 2 0
maedhros - 17 years ago 2007-07-08 18:40:15
maedhros@openttd.org
(svn r10480) -Fix: Don't allow building lighthouses and transmitters under bridges in the scenario editor, or during world generation.
2 files changed with 6 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/main_gui.cpp
Show inline comments
 
@@ -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(TileInde
 

	
 
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(TileInd
 

	
 
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;
 
	}
 

	
src/unmovable_cmd.cpp
Show inline comments
 
@@ -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));
 

	
0 comments (0 inline, 0 general)