summaryrefslogtreecommitdiff
path: root/src/autoreplace_cmd.cpp
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-09-05 10:33:42 +0000
committerbjarni <bjarni@openttd.org>2007-09-05 10:33:42 +0000
commitf7d1c125b1810cf7a84eb632b42a280389e4ed04 (patch)
tree9c5f0b9c4f22f47f718b1ae11e95f12766c8a843 /src/autoreplace_cmd.cpp
parent7cdf6d1cbe83bb28f56819abc40092f4d865c5ac (diff)
downloadopenttd-f7d1c125b1810cf7a84eb632b42a280389e4ed04.tar.xz
(svn r11046) -Codechange: added function to get the next movable (non-articulated, non-read end of dualheaded engine) vehicle in a train
Diffstat (limited to 'src/autoreplace_cmd.cpp')
-rw-r--r--src/autoreplace_cmd.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index 4791dde3c..ca0d2c06e 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -249,8 +249,7 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost)
CommandCost tmp_move;
if (old_v->type == VEH_TRAIN && IsFrontEngine(old_v)) {
- Vehicle *next_veh = GetNextVehicle(old_v);
- if (IsRearDualheaded(next_veh)) next_veh = next_veh->Next(); // don't try to move the rear multiheaded engine
+ Vehicle *next_veh = GetNextUnit(old_v); // don't try to move the rear multiheaded engine or articulated parts
if (next_veh != NULL) {
/* Verify that the wagons can be placed on the engine in question.
* This is done by building an engine, test if the wagons can be added and then sell the test engine. */