From ec48e0a72bb94baca4fe9acc674a3c4843566508 Mon Sep 17 00:00:00 2001 From: glx Date: Fri, 22 Sep 2006 21:52:31 +0000 Subject: (svn r6495) -Codechange: removed direct map access in pathfind.c --- pathfind.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pathfind.c b/pathfind.c index 8ab14c19b..9b8cfc3ec 100644 --- a/pathfind.c +++ b/pathfind.c @@ -802,21 +802,18 @@ start_at: // railway tile with signals..? if (HasSignals(tile)) { - byte m3; - - m3 = _m[tile].m3; - if (!(m3 & SignalAlongTrackdir(track))) { + if (!HasSignalOnTrackdir(tile, track)) { // if one way signal not pointing towards us, stop going in this direction => End of rail segment. - if (m3 & SignalAgainstTrackdir(track)) { + if (HasSignalOnTrackdir(tile, ReverseTrackdir(track))) { bits = 0; break; } - } else if (_m[tile].m2 & SignalAlongTrackdir(track)) { + } else if (GetSignalStateByTrackdir(tile, track) == SIGNAL_STATE_GREEN) { // green signal in our direction. either one way or two way. si.state |= 3; } else { // reached a red signal. - if (m3 & SignalAgainstTrackdir(track)) { + if (HasSignalOnTrackdir(tile, ReverseTrackdir(track))) { // two way red signal. unless we passed another green signal on the way, // stop going in this direction => End of rail segment. // this is to prevent us from going into a full platform. -- cgit v1.2.3-70-g09d2