mirror of https://github.com/OpenTTD/OpenTTD
(svn r23745) -Fix (r23087): If autorefit fails, count the vehicle capacity nevertheless, if it is already carrying the right thing.
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. */
|
/* Sorry, auto-refitting not allowed, subtract the cargo amount again from the total. */
|
||||||
total_capacity -= amount;
|
total_capacity -= amount;
|
||||||
total_mail_capacity -= mail_capacity;
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
cost.AddCost(refit_cost);
|
cost.AddCost(refit_cost);
|
||||||
|
|
Loading…
Reference in New Issue