Mercurial > hg > openttd
changeset 18896:d49d36426418 draft
(svn r23745) -Fix (r23087): If autorefit fails, count the vehicle capacity nevertheless, if it is already carrying the right thing.
author | frosch <frosch@openttd.org> |
---|---|
date | Tue, 03 Jan 2012 23:08:15 +0000 |
parents | d0ca24721a85 |
children | cffc845d72c5 |
files | src/vehicle_cmd.cpp |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -357,6 +357,12 @@ /* 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);