summaryrefslogtreecommitdiff
path: root/elrail.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-30 09:08:43 +0000
committertron <tron@openttd.org>2006-03-30 09:08:43 +0000
commit410b5569fe85ee1c34fbcadd39d8c78801133411 (patch)
tree11bf0f9de75c2bc770acc39ef886696c744b9f4e /elrail.c
parenta71ece5ffbf90491a164a03333fc55a44716e81b (diff)
downloadopenttd-410b5569fe85ee1c34fbcadd39d8c78801133411.tar.xz
(svn r4164) Use acessor functions
Diffstat (limited to 'elrail.c')
-rw-r--r--elrail.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/elrail.c b/elrail.c
index cfe69b2ab..1e8fea803 100644
--- a/elrail.c
+++ b/elrail.c
@@ -45,6 +45,7 @@ the pylon would be rectangular to the track). PPPs are represented by the Direct
#include "stdafx.h"
#include "openttd.h"
+#include "station_map.h"
#include "tile.h"
#include "viewport.h"
#include "functions.h" /* We should REALLY get rid of this goddamn file, as it is butt-ugly */
@@ -83,7 +84,7 @@ static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override)
if (IsTunnel(t)) {
if (GetRailType(t) != RAILTYPE_ELECTRIC) return 0;
if (override != NULL) *override = 1 << GetTunnelDirection(t);
- return (_m[t].m5 & 1) ? TRACK_BIT_Y : TRACK_BIT_X;
+ return DiagDirToAxis(GetTunnelDirection(t)) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y;
} else {
if (GetRailType(t) != RAILTYPE_ELECTRIC) return 0;
if (
@@ -98,11 +99,11 @@ static TrackBits GetRailTrackBitsUniversal(TileIndex t, byte *override)
}
}
case MP_STREET:
- if ((_m[t].m4 & 0xF) != RAILTYPE_ELECTRIC) return 0;
+ if (GetRailTypeCrossing(t) != RAILTYPE_ELECTRIC) return 0;
return GetCrossingRailBits(t);
case MP_STATION:
if (GetRailType(t) != RAILTYPE_ELECTRIC) return 0;
- return _m[t].m5 & 1 ? TRACK_BIT_Y : TRACK_BIT_X;
+ return GetRailStationTrack(t);
default:
return 0;
}