mirror of https://github.com/OpenTTD/OpenTTD
(svn r21524) -Fix [FS#4302]: Do not apply the last signal red pathfinder penalty when the signal is a path signal.
parent
fc42e98226
commit
e744b97ec8
|
@ -469,8 +469,9 @@ static int32 NPFRailPathCost(AyStar *as, AyStarNode *current, OpenListNode *pare
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Record the state of this signal */
|
/* Record the state of this signal. Path signals are assumed to
|
||||||
NPFSetFlag(current, NPF_FLAG_LAST_SIGNAL_RED, true);
|
* be green as the signal state of them has no meaning for this. */
|
||||||
|
NPFSetFlag(current, NPF_FLAG_LAST_SIGNAL_RED, !IsPbsSignal(sigtype));
|
||||||
} else {
|
} else {
|
||||||
/* Record the state of this signal */
|
/* Record the state of this signal */
|
||||||
NPFSetFlag(current, NPF_FLAG_LAST_SIGNAL_RED, false);
|
NPFSetFlag(current, NPF_FLAG_LAST_SIGNAL_RED, false);
|
||||||
|
|
|
@ -587,8 +587,8 @@ no_entry_cost: // jump here at the beginning if the node has no parent (it is th
|
||||||
if (n.m_last_red_signal_type == SIGTYPE_EXIT) {
|
if (n.m_last_red_signal_type == SIGTYPE_EXIT) {
|
||||||
/* last signal was red pre-signal-exit */
|
/* last signal was red pre-signal-exit */
|
||||||
extra_cost += Yapf().PfGetSettings().rail_lastred_exit_penalty;
|
extra_cost += Yapf().PfGetSettings().rail_lastred_exit_penalty;
|
||||||
} else {
|
} else if (!IsPbsSignal(n.m_last_red_signal_type)) {
|
||||||
/* last signal was red, but not exit */
|
/* Last signal was red, but not exit or path signal. */
|
||||||
extra_cost += Yapf().PfGetSettings().rail_lastred_penalty;
|
extra_cost += Yapf().PfGetSettings().rail_lastred_penalty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue