diff options
author | terkhen <terkhen@openttd.org> | 2010-11-16 20:56:04 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2010-11-16 20:56:04 +0000 |
commit | c96cb9ce3757f90384f8cd624eb3f2878db477ff (patch) | |
tree | 9f41f296f8683d04a70230d0c8f06323443bc56d /src/vehicle_cmd.cpp | |
parent | 07ad8851ccd6d1f47a379fe9e19eb257048a9fdf (diff) | |
download | openttd-c96cb9ce3757f90384f8cd624eb3f2878db477ff.tar.xz |
(svn r21214) -Add: Display mail capacity when refitting an aircraft to passengers.
Diffstat (limited to 'src/vehicle_cmd.cpp')
-rw-r--r-- | src/vehicle_cmd.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 84f960976..4d29ac495 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -254,6 +254,7 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, CargoID new_cid, byt { CommandCost cost(v->GetExpenseType(false)); uint total_capacity = 0; + uint total_mail_capacity = 0; v->InvalidateNewGRFCacheOfChain(); for (; v != NULL; v = (only_this ? NULL : v->Next())) { @@ -266,9 +267,11 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, CargoID new_cid, byt v->cargo_type = new_cid; v->cargo_subtype = new_subtype; - uint16 mail_capacity; + uint16 mail_capacity = 0; uint amount = GetVehicleCapacity(v, &mail_capacity); total_capacity += amount; + /* mail_capacity will always be zero if the vehicle is not an aircraft. */ + total_mail_capacity += mail_capacity; /* Restore the original cargo type */ v->cargo_type = temp_cid; @@ -292,6 +295,7 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, CargoID new_cid, byt } _returned_refit_capacity = total_capacity; + _returned_mail_refit_capacity = total_mail_capacity; return cost; } |