Mercurial > hg > openttd
diff src/train_cmd.cpp @ 12450:af266072d46c draft
(svn r16884) -Codechange: Add Train::GetFirstEnginePart() and use it.
author | frosch <frosch@openttd.org> |
---|---|
date | Sun, 19 Jul 2009 19:17:41 +0000 (2009-07-19) |
parents | c3588e7cb8f6 |
children | 4acae7d6f5ed |
line wrap: on
line diff
--- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1105,9 +1105,9 @@ } /* if an articulated part is being handled, deal with its parent vehicle */ - while (src->IsArticulatedPart()) src = src->Previous(); + src = src->GetFirstEnginePart(); if (dst != NULL) { - while (dst->IsArticulatedPart()) dst = dst->Previous(); + dst = dst->GetFirstEnginePart(); } /* don't move the same vehicle.. */ @@ -1445,7 +1445,7 @@ if (v->vehstatus & VS_CRASHED) return_cmd_error(STR_CAN_T_SELL_DESTROYED_VEHICLE); - while (v->IsArticulatedPart()) v = v->Previous(); + v = v->GetFirstEnginePart(); Train *first = v->First(); /* make sure the vehicle is stopped in the depot */