summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2006-09-22 21:52:31 +0000
committerglx <glx@openttd.org>2006-09-22 21:52:31 +0000
commitec48e0a72bb94baca4fe9acc674a3c4843566508 (patch)
tree0a4e96cad3e9e039071b14c2df24e77843cf0152
parent239f694e4eab09573c21aa1a6afc844c83a599a7 (diff)
downloadopenttd-ec48e0a72bb94baca4fe9acc674a3c4843566508.tar.xz
(svn r6495) -Codechange: removed direct map access in pathfind.c
-rw-r--r--pathfind.c11
1 files 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.