mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r5175) -Fix: [autoreplace] FS#186 autoreplaced trains can leave all wagons in depot
also fixed a serious typo in peter1138's comments
This commit is contained in:
parent
5ab592667f
commit
bbe4285a03
@ -839,8 +839,10 @@ int CheckTrainStoppedInDepot(const Vehicle *v)
|
|||||||
for (; v != NULL; v = v->next) {
|
for (; v != NULL; v = v->next) {
|
||||||
/* This count is used by the depot code to determine the number of engines
|
/* This count is used by the depot code to determine the number of engines
|
||||||
* in the consist. Exclude articulated parts so that autoreplacing to
|
* in the consist. Exclude articulated parts so that autoreplacing to
|
||||||
* engines with more articulated parts that before works correctly. */
|
* engines with more articulated parts that before works correctly.
|
||||||
if (!IsArticulatedPart(v)) count++;
|
*
|
||||||
|
* Also skip counting rear ends of multiheaded engines */
|
||||||
|
if (!IsArticulatedPart(v) && !(!IsTrainEngine(v) && IsMultiheaded(v))) count++;
|
||||||
if (v->u.rail.track != 0x80 || v->tile != tile ||
|
if (v->u.rail.track != 0x80 || v->tile != tile ||
|
||||||
(IsFrontEngine(v) && !(v->vehstatus & VS_STOPPED))) {
|
(IsFrontEngine(v) && !(v->vehstatus & VS_STOPPED))) {
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user