src/autoreplace_cmd.cpp
changeset 8023 67fdef8a686e
parent 8022 32b885de2410
child 8424 4a488a90ccab
--- a/src/autoreplace_cmd.cpp	Wed Sep 05 10:15:23 2007 +0000
+++ b/src/autoreplace_cmd.cpp	Wed Sep 05 10:33:42 2007 +0000
@@ -249,8 +249,7 @@
 		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. */