diff options
author | celestar <celestar@openttd.org> | 2006-06-02 13:05:41 +0000 |
---|---|---|
committer | celestar <celestar@openttd.org> | 2006-06-02 13:05:41 +0000 |
commit | 25a63ec7af6fadb2d33ef84f79597c14b10e7f39 (patch) | |
tree | d5df4e2831609eca45d7ea4558e09a600089ead2 /town_cmd.c | |
parent | d680fcec772d422b88ea4802add2e6195c6327a2 (diff) | |
download | openttd-25a63ec7af6fadb2d33ef84f79597c14b10e7f39.tar.xz |
(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.
Diffstat (limited to 'town_cmd.c')
-rw-r--r-- | town_cmd.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/town_cmd.c b/town_cmd.c index 2c7a8653c..590641406 100644 --- a/town_cmd.c +++ b/town_cmd.c @@ -26,6 +26,7 @@ #include "water_map.h" #include "variables.h" #include "bridge.h" +#include "bridge_map.h" #include "table/town_land.h" enum { @@ -1093,6 +1094,8 @@ static bool CheckBuildHouseMode(TileIndex tile, Slope tileh, int mode) slope = GetTileSlope(tile, NULL); if (IsSteepSlope(slope)) return false; + if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return false; + b = 0; if ((slope != SLOPE_FLAT && ~slope & _masks[mode])) b = ~b; if ((tileh != SLOPE_FLAT && ~tileh & _masks[mode+4])) b = ~b; @@ -1136,6 +1139,8 @@ static bool CheckFree2x2Area(TileIndex tile) if (GetTileSlope(tile, NULL) != SLOPE_FLAT) return false; + if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return false; + if (CmdFailed(DoCommand(tile, 0, 0, DC_EXEC | DC_AUTO | DC_NO_WATER | DC_FORCETEST, CMD_LANDSCAPE_CLEAR))) return false; } @@ -1270,6 +1275,7 @@ static bool BuildTownHouse(Town *t, TileIndex tile) // make sure it's possible if (!EnsureNoVehicle(tile)) return false; if (IsSteepSlope(GetTileSlope(tile, NULL))) return false; + if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return false; r = DoCommand(tile, 0, 0, DC_EXEC | DC_AUTO | DC_NO_WATER, CMD_LANDSCAPE_CLEAR); if (CmdFailed(r)) return false; |