diff options
author | frosch <frosch@openttd.org> | 2009-11-01 08:48:16 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-11-01 08:48:16 +0000 |
commit | 3a95e115fc1a2e91c28d3f9f98cab0fecafe875c (patch) | |
tree | 9438c74655213e4756484bc027584e4e7c6f9109 | |
parent | 2d5aebb1f127623a39eeeea0b02bd75ee268ad45 (diff) | |
download | openttd-3a95e115fc1a2e91c28d3f9f98cab0fecafe875c.tar.xz |
(svn r17930) -Fix (r17926): Aircraft were not carrying mail anymore, when CB15 was in use.
-rw-r--r-- | src/vehicle.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 9cee5abd6..da2e43dfe 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1387,6 +1387,9 @@ uint GetVehicleCapacity(const Vehicle *v, uint16 *mail_capacity) if (!e->CanCarryCargo()) return 0; + if (mail_capacity != NULL && e->type == VEH_AIRCRAFT && IsCargoInClass(v->cargo_type, CC_PASSENGERS)) { + *mail_capacity = e->u.air.mail_capacity; + } CargoID default_cargo = e->GetDefaultCargoType(); /* Check the refit capacity callback if we are not in the default configuration. @@ -1411,9 +1414,7 @@ uint GetVehicleCapacity(const Vehicle *v, uint16 *mail_capacity) * Note: This might change to become more consistent/flexible. */ if (e->type != VEH_SHIP) { if (e->type == VEH_AIRCRAFT) { - if (IsCargoInClass(v->cargo_type, CT_PASSENGERS)) { - if (mail_capacity != NULL) *mail_capacity = e->u.air.mail_capacity; - } else { + if (!IsCargoInClass(v->cargo_type, CT_PASSENGERS)) { capacity += e->u.air.mail_capacity; } if (v->cargo_type == CT_MAIL) return capacity; |