summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-08-15 15:27:30 +0000
committerbjarni <bjarni@openttd.org>2006-08-15 15:27:30 +0000
commit08fd0bed1f443ade7050613a0f7de103a6c4e40c (patch)
tree5bc2a3191def889671b28658308e3eb39ddaf038 /vehicle.c
parent0d3ccad29fb035fced3a1a87b7804fde8c4e94b1 (diff)
downloadopenttd-08fd0bed1f443ade7050613a0f7de103a6c4e40c.tar.xz
(svn r5917) -Fix: [clone vehicles] FS#275 Bugfix: Cloned Road Vehicles Are Not Refitted To Correct Cargo (Mart3p)
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/vehicle.c b/vehicle.c
index 9eb997a36..0c0edc92e 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -1577,12 +1577,10 @@ int32 CmdCloneVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (flags & DC_EXEC) {
w = GetVehicle(_new_vehicle_id);
- if (v->type != VEH_Road) { // road vehicles can't be refitted
- if (v->cargo_type != w->cargo_type) {
- // we can't pay for refitting because we can't estimate refitting costs for a vehicle before it's build
- // if we pay for it anyway, the cost and the estimated cost will not be the same and we will have an assert
- DoCommand(0, w->index, v->cargo_type, flags, CMD_REFIT_VEH(v->type));
- }
+ if (v->cargo_type != w->cargo_type) {
+ // we can't pay for refitting because we can't estimate refitting costs for a vehicle before it's build
+ // if we pay for it anyway, the cost and the estimated cost will not be the same and we will have an assert
+ DoCommand(0, w->index, v->cargo_type, flags, CMD_REFIT_VEH(v->type));
}
if (v->type == VEH_Train && HASBIT(v->u.rail.flags, VRF_REVERSE_DIRECTION)) {
SETBIT(w->u.rail.flags, VRF_REVERSE_DIRECTION);