1
0
Fork 0

(svn r5289) - Backport from trunk (r5175, r5176):

Autoreplaced trains can leave all wagons in depot under certain circumstances
release/0.4
Darkvater 2006-06-16 18:59:26 +00:00
parent 73dab80259
commit 7fd164deba
1 changed files with 4 additions and 2 deletions

View File

@ -819,8 +819,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 than 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))) {
_error_message = STR_881A_TRAINS_CAN_ONLY_BE_ALTERED; _error_message = STR_881A_TRAINS_CAN_ONLY_BE_ALTERED;