diff options
author | peter1138 <peter1138@openttd.org> | 2006-10-23 16:47:20 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-10-23 16:47:20 +0000 |
commit | 326fef684faa39371e9be711af80e208f20994b8 (patch) | |
tree | 754f2219ec1e8d6fc53148ca27c0caf3a06e655f /vehicle.c | |
parent | 9c1e89b0c09827a74a5ce6f36435d59f52c6e79a (diff) | |
download | openttd-326fef684faa39371e9be711af80e208f20994b8.tar.xz |
(svn r6905) - Codechange: Copy cargo subtype when cloning vehicles.
Diffstat (limited to 'vehicle.c')
-rw-r--r-- | vehicle.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1828,10 +1828,10 @@ int32 CmdCloneVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) if (flags & DC_EXEC) { w = GetVehicle(_new_vehicle_id); - if (v->cargo_type != w->cargo_type) { + if (v->cargo_type != w->cargo_type || v->cargo_subtype != w->cargo_subtype) { // 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)); + DoCommand(0, w->index, v->cargo_type | (v->cargo_subtype << 8), 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); |