summaryrefslogtreecommitdiff
path: root/rail.c
diff options
context:
space:
mode:
authormatthijs <matthijs@openttd.org>2005-07-03 13:02:54 +0000
committermatthijs <matthijs@openttd.org>2005-07-03 13:02:54 +0000
commitfb8e5f61b181ca34c43d0a0e8d39ee95af2eb60a (patch)
tree6d371024326a8ed726a5b94394047c888bd1a2c8 /rail.c
parent6df35235d5b610262af8777cf2047245d271e5c9 (diff)
downloadopenttd-fb8e5f61b181ca34c43d0a0e8d39ee95af2eb60a.tar.xz
(svn r2514) - Codechange: [NPF] Move the checking of railtype into a funciton IsCompatibleRail().
- Codechange: [NPF] Check the railtype along a route against the engine type instead of against the previouse tile. This clears the way for electriefied rails. - Add: [NPF] [ 1209644 ] A penalty for crossings (peter1138)
Diffstat (limited to 'rail.c')
-rw-r--r--rail.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rail.c b/rail.c
index 89fb87c52..670b8345b 100644
--- a/rail.c
+++ b/rail.c
@@ -97,7 +97,7 @@ const Trackdir _reverse_trackdir[] = {
TRACKDIR_DIAG1_NE, TRACKDIR_DIAG2_SE, TRACKDIR_UPPER_E, TRACKDIR_LOWER_E, TRACKDIR_LEFT_S, TRACKDIR_RIGHT_S
};
-RailType GetTileRailType(TileIndex tile, byte trackdir)
+RailType GetTileRailType(TileIndex tile, Trackdir trackdir)
{
RailType type = INVALID_RAILTYPE;
switch (GetTileType(tile)) {
@@ -123,7 +123,7 @@ RailType GetTileRailType(TileIndex tile, byte trackdir)
if ((_map5[tile] & 0xC6) == 0xC0 && ((DiagDirection)(_map5[tile] & 0x1)) == (TrackdirToExitdir(trackdir) & 0x1))
type = (_map3_lo[tile] >> 4) & RAILTYPE_MASK;
/* under bridge (any type) */
- if ((_map5[tile] & 0xC0) == 0xC0 && (_map5[tile] & 0x1) != (trackdir & 0x1))
+ if ((_map5[tile] & 0xC0) == 0xC0 && ((uint)_map5[tile] & 0x1) != (trackdir & 0x1))
type = _map3_lo[tile] & RAILTYPE_MASK;
break;
default: