changeset 14176:41303b56f42c draft

(svn r18724) -Fix [FS#3475] (r17899): refitting a non-refittable vehicle to it's default cargotype failed, causing problems for AIs
author yexo <yexo@openttd.org>
date Mon, 04 Jan 2010 18:50:50 +0000
parents f1393258ecd5
children 3703b52f8d36
files src/vehicle_cmd.cpp
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/vehicle_cmd.cpp
+++ b/src/vehicle_cmd.cpp
@@ -307,13 +307,11 @@
 {
 	CommandCost cost(v->GetExpenseType(false));
 	uint total_capacity = 0;
-	bool success = false;
 
 	v->InvalidateNewGRFCacheOfChain();
 	for (; v != NULL; v = (only_this ? NULL : v->Next())) {
 		const Engine *e = Engine::Get(v->engine_type);
 		if (!e->CanCarryCargo() || !HasBit(e->info.refit_mask, new_cid)) continue;
-		success = true;
 
 		/* Back up the vehicle's cargo type */
 		CargoID temp_cid = v->cargo_type;
@@ -347,7 +345,7 @@
 	}
 
 	_returned_refit_capacity = total_capacity;
-	return success ? cost : CMD_ERROR;
+	return cost;
 }
 
 /** Test if a name is unique among vehicle names.