From 00ec5da36161b2070fcf382a41f9d6b72ab6290f Mon Sep 17 00:00:00 2001 From: frosch Date: Tue, 3 Jan 2012 23:08:15 +0000 Subject: [PATCH] (svn r23745) -Fix (r23087): If autorefit fails, count the vehicle capacity nevertheless, if it is already carrying the right thing. --- src/vehicle_cmd.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 21a0ced014..32f4eaec36 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -357,6 +357,12 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles, /* Sorry, auto-refitting not allowed, subtract the cargo amount again from the total. */ total_capacity -= amount; total_mail_capacity -= mail_capacity; + + if (v->cargo_type == new_cid) { + /* Add the old capacity nevertheless, if the cargo matches */ + total_capacity += v->cargo_cap; + if (v->type == VEH_AIRCRAFT) total_mail_capacity += v->Next()->cargo_cap; + } continue; } cost.AddCost(refit_cost);