mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-23 06:29:11 +00:00
(svn r5070) Merged the bridge branch
-Feature: Bridges can now be placed above: Any railway track combination (excluding depots and waypoints) Any road combination (excluding depots) Clear tiles (duh), including fields Tunnel entrances Bridge heads Thanks to Tron for idea and implementation, KUDr for the yapf synchronization and many others for hours of testing There are still a number of visual problems remaining, especially when electric railways are on or under the bridge. DO NOT REPORT THOSE BUGS FOR THE TIME BEING please.
This commit is contained in:
10
clear_cmd.c
10
clear_cmd.c
@@ -11,6 +11,7 @@
|
||||
#include "viewport.h"
|
||||
#include "command.h"
|
||||
#include "tunnel_map.h"
|
||||
#include "bridge_map.h"
|
||||
#include "variables.h"
|
||||
#include "table/sprites.h"
|
||||
#include "unmovable_map.h"
|
||||
@@ -259,6 +260,14 @@ int32 CmdTerraformLand(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||
} else return_cmd_error(STR_5800_OBJECT_IN_THE_WAY);
|
||||
}
|
||||
|
||||
if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) {
|
||||
byte height = GetBridgeHeight(GetNorthernBridgeEnd(tile), GetBridgeAxis(tile));
|
||||
|
||||
height /= TILE_HEIGHT;
|
||||
|
||||
if (a >= height || b >= height || c >= height || d >= height) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
|
||||
}
|
||||
|
||||
if (direction == -1 && IsTunnelInWay(tile, min)) return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE);
|
||||
|
||||
_terraform_err_tile = 0;
|
||||
@@ -501,6 +510,7 @@ static void DrawTile_Clear(TileInfo *ti)
|
||||
}
|
||||
|
||||
DrawClearLandFence(ti);
|
||||
DrawBridgeMiddle(ti);
|
||||
}
|
||||
|
||||
static uint GetSlopeZ_Clear(const TileInfo* ti)
|
||||
|
Reference in New Issue
Block a user