diff options
Diffstat (limited to 'src/engine_gui.cpp')
-rw-r--r-- | src/engine_gui.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 84a344c82..b514df55d 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -14,6 +14,7 @@ #include "engine_gui.h" #include "articulated_vehicles.h" #include "rail.h" +#include "aircraft.h" #include "table/strings.h" #include "table/sprites.h" @@ -144,16 +145,26 @@ static void DrawTrainEngineInfo(EngineID engine, int x, int y, int maxw) static void DrawAircraftEngineInfo(EngineID engine, int x, int y, int maxw) { - const AircraftVehicleInfo *avi = AircraftVehInfo(engine); const Engine *e = GetEngine(engine); + CargoID cargo = e->GetDefaultCargoType(); - SetDParam(0, e->GetCost()); - SetDParam(1, e->GetDisplayMaxSpeed()); - SetDParam(2, avi->passenger_capacity); - SetDParam(3, avi->mail_capacity); - SetDParam(4, e->GetRunningCost()); + if (cargo == CT_INVALID || cargo == CT_PASSENGERS) { + SetDParam(0, e->GetCost()); + SetDParam(1, e->GetDisplayMaxSpeed()); + SetDParam(2, e->u.air.passenger_capacity); + SetDParam(3, e->u.air.mail_capacity); + SetDParam(4, e->GetRunningCost()); - DrawStringMultiCenter(x, y, STR_A02E_COST_MAX_SPEED_CAPACITY, maxw); + DrawStringMultiCenter(x, y, STR_A02E_COST_MAX_SPEED_CAPACITY, maxw); + } else { + SetDParam(0, e->GetCost()); + SetDParam(1, e->GetDisplayMaxSpeed()); + SetDParam(2, cargo); + SetDParam(3, AircraftDefaultCargoCapacity(cargo, &e->u.air)); + SetDParam(4, e->GetRunningCost()); + + DrawStringMultiCenter(x, y, STR_982E_COST_MAX_SPEED_CAPACITY, maxw); + } } static void DrawRoadVehEngineInfo(EngineID engine, int x, int y, int maxw) |