(svn r3857) Add and use GetBridgeRampDirection()

Note: This slightly changes the behavior of GetAnyRoadBits() to only return a road piece for the start of the bridge ramp instead of a full ROAD_[XY]
This commit is contained in:
tron
2006-03-14 12:00:11 +00:00
parent b2412f7472
commit 42d1731cc1
5 changed files with 27 additions and 13 deletions

View File

@@ -2,6 +2,7 @@
#include "stdafx.h"
#include "openttd.h"
#include "bridge_map.h"
#include "functions.h"
#include "road_map.h"
#include "station.h"
@@ -33,7 +34,7 @@ RoadBits GetAnyRoadBits(TileIndex tile)
} else {
// ending
if (GB(_m[tile].m5, 1, 2) != TRANSPORT_ROAD) return 0; // not a road bridge
return _m[tile].m5 & 1 ? ROAD_Y : ROAD_X;
return DiagDirToRoadBits(ReverseDiagDir(GetBridgeRampDirection(tile)));
}
} else {
// tunnel