summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-04-27 23:11:43 +0000
committerbjarni <bjarni@openttd.org>2006-04-27 23:11:43 +0000
commit246e53d2060b4a6531608a17cf8a11d14a03f150 (patch)
tree23e644d0b22ca3de9f08a007201261e766b6ea75
parent02d07a056f5fbef6882d99c4ac0b2c614875bd2e (diff)
downloadopenttd-246e53d2060b4a6531608a17cf8a11d14a03f150.tar.xz
(svn r4599) -Fix: [Cloning, autoreplace] FS#141 clone service-interval
now cloned vehicles get the same service interval as the original vehicle I applied this to autoreplace as well even though it's not mentioned in the bug report (autorenew should not alter service interval)
-rw-r--r--vehicle.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vehicle.c b/vehicle.c
index 7ba098751..2522bf5e1 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -1567,6 +1567,7 @@ int32 CmdCloneVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
} else {
// this is a front engine or not a train. It need orders
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);
}
w_rear = w; // trains needs to know the last car in the train, so they can add more in next loop
@@ -1666,6 +1667,7 @@ static int32 ReplaceVehicle(Vehicle **w, byte flags)
ChangeVehicleViewWindow(old_v, new_v);
new_v->profit_this_year = old_v->profit_this_year;
new_v->profit_last_year = old_v->profit_last_year;
+ new_v->service_interval = old_v->service_interval;
new_front = true;
new_v->current_order = old_v->current_order;