summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/vehicle_cmd.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp
index 21a0ced01..32f4eaec3 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);