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
commit4921538e1d5b9ac557bc47abcb77bdfe951ac543 (patch)
tree0a4e96cad3e9e039071b14c2df24e77843cf0152
parentb51a42438bfaef626fdfce0fd634c89cb5940062 (diff)
downloadopenttd-4921538e1d5b9ac557bc47abcb77bdfe951ac543.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.