summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-05-11 14:24:33 +0000
committerbjarni <bjarni@openttd.org>2006-05-11 14:24:33 +0000
commitcbcf207e5ed19e95735e832a553f4a0e4fb51ef7 (patch)
treeded6a348fe8dcf285381b33df1de000d4bf51472 /vehicle.c
parent6d40f9cc4fba44ba089434e7fd036577afb7c8f7 (diff)
downloadopenttd-cbcf207e5ed19e95735e832a553f4a0e4fb51ef7.tar.xz
(svn r4829) -Codechage: [clone vehilces] only check for a free unitnumber for the first engine in the test run as well as execute run (to improve speed. The result should be unchanged)
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vehicle.c b/vehicle.c
index 3d1103014..63d861129 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -1534,6 +1534,7 @@ int32 CmdCloneVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
}
cost = DoCommand(tile, v->engine_type, build_argument, flags, CMD_BUILD_VEH(v->type));
+ build_argument = 3; // ensure that we only assign a number to the first engine
if (CmdFailed(cost)) return cost;
@@ -1556,7 +1557,6 @@ int32 CmdCloneVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
DoCommand(0, (w_rear->index << 16) | w->index, 1, flags, CMD_MOVE_RAIL_VEHICLE);
} else {
// this is a front engine or not a train. It need orders
- build_argument = 3; // set bit 1, so it will not assign numbers to engines in the rest of the train
w_front = w;
w->service_interval = v->service_interval;
DoCommand(0, (v->index << 16) | w->index, p2 & 1 ? CO_SHARE : CO_COPY, flags, CMD_CLONE_ORDER);