summaryrefslogtreecommitdiff
path: root/src/pathfinder/npf/npf.cpp
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2010-12-15 14:33:24 +0000
committermichi_cc <michi_cc@openttd.org>2010-12-15 14:33:24 +0000
commite744b97ec8bfe567136200096d2279bce982d160 (patch)
tree58c4abe433179344cba7f37c25431b25dd071dc0 /src/pathfinder/npf/npf.cpp
parentfc42e98226f37b1b32bd9b34ca6fc7d06c9f0c27 (diff)
downloadopenttd-e744b97ec8bfe567136200096d2279bce982d160.tar.xz
(svn r21524) -Fix [FS#4302]: Do not apply the last signal red pathfinder penalty when the signal is a path signal.
Diffstat (limited to 'src/pathfinder/npf/npf.cpp')
-rw-r--r--src/pathfinder/npf/npf.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp
index e8e13f5fd..4f277cdcc 100644
--- a/src/pathfinder/npf/npf.cpp
+++ b/src/pathfinder/npf/npf.cpp
@@ -469,8 +469,9 @@ static int32 NPFRailPathCost(AyStar *as, AyStarNode *current, OpenListNode *pare
}
}
}
- /* Record the state of this signal */
- NPFSetFlag(current, NPF_FLAG_LAST_SIGNAL_RED, true);
+ /* Record the state of this signal. Path signals are assumed to
+ * be green as the signal state of them has no meaning for this. */
+ NPFSetFlag(current, NPF_FLAG_LAST_SIGNAL_RED, !IsPbsSignal(sigtype));
} else {
/* Record the state of this signal */
NPFSetFlag(current, NPF_FLAG_LAST_SIGNAL_RED, false);