changeset 4287:5da967374aa6 draft

(svn r5917) -Fix: [clone vehicles] FS#275 Bugfix: Cloned Road Vehicles Are Not Refitted To Correct Cargo (Mart3p)
author bjarni <bjarni@openttd.org>
date Tue, 15 Aug 2006 15:27:30 +0000
parents 9594c2c9c53a
children d0dcf9d45ffa
files vehicle.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/vehicle.c
+++ b/vehicle.c
@@ -1577,12 +1577,10 @@
 		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);