diff options
author | frosch <frosch@openttd.org> | 2009-03-13 23:49:12 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-03-13 23:49:12 +0000 |
commit | fa35dc10e5e2924f971e6787d74d3f229514960b (patch) | |
tree | daf417673f6b645f018e9c864b81143d176c5389 /src/build_vehicle_gui.cpp | |
parent | 40745dc0d95a25fbbbbd0f019e825d8b41f99f8e (diff) | |
download | openttd-fa35dc10e5e2924f971e6787d74d3f229514960b.tar.xz |
(svn r15705) -Fix: Do not show passenger-/mail-capacity if the aircraft carries only cargo.
Diffstat (limited to 'src/build_vehicle_gui.cpp')
-rw-r--r-- | src/build_vehicle_gui.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 30cbf1781..de6f339f0 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -237,8 +237,11 @@ static int CDECL ShipEngineCapacitySorter(const void *a, const void *b) /* Aircraft sorting functions */ static int CDECL AircraftEngineCargoSorter(const void *a, const void *b) { - int va = AircraftVehInfo(*(const EngineID*)a)->passenger_capacity; - int vb = AircraftVehInfo(*(const EngineID*)b)->passenger_capacity; + const Engine *e_a = GetEngine(*(const EngineID*)a); + const Engine *e_b = GetEngine(*(const EngineID*)b); + + int va = AircraftDefaultCargoCapacity(e_a->GetDefaultCargoType(), &e_a->u.air); + int vb = AircraftDefaultCargoCapacity(e_b->GetDefaultCargoType(), &e_b->u.air); int r = va - vb; if (r == 0) { |