(svn r23745) -Fix (r23087): If autorefit fails, count the vehicle capacity nevertheless, if it is already carrying the right thing.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
frosch 13 years ago
parent 7ff95b9e97
commit 00ec5da361

@ -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);

Loading…
Cancel
Save