diff options
author | Darkvater <darkvater@openttd.org> | 2007-01-27 12:29:55 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2007-01-27 12:29:55 +0000 |
commit | 50ca901b40664453fe90a396577e6438fd45dc27 (patch) | |
tree | c85d1c112d4c04fb8079a90418ad3b654765dff3 /src/aircraft_gui.cpp | |
parent | 8bebb83de97756e1781c418dc1fcc021fad483db (diff) | |
download | openttd-50ca901b40664453fe90a396577e6438fd45dc27.tar.xz |
(svn r8428) -Codechange: Add proper names to aircraft subtypes instead of magic numbers and add a function IsNormalAircraft() which tells us whether the aircraft is in fact some flying device or a rotor/shadow.
Diffstat (limited to 'src/aircraft_gui.cpp')
-rw-r--r-- | src/aircraft_gui.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/aircraft_gui.cpp b/src/aircraft_gui.cpp index b5b2f95e3..ef641ca7c 100644 --- a/src/aircraft_gui.cpp +++ b/src/aircraft_gui.cpp @@ -24,7 +24,7 @@ void DrawAircraftImage(const Vehicle *v, int x, int y, VehicleID selection) { SpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v); DrawSprite(GetAircraftImage(v, DIR_W), pal, x + 25, y + 10); - if (v->subtype == 0) { + if (v->subtype == AIR_HELICOPTER) { SpriteID rotor_sprite = GetCustomRotorSprite(v, true); if (rotor_sprite == 0) rotor_sprite = SPR_ROTOR_STOPPED; DrawSprite(rotor_sprite, PAL_NONE, x + 25, y + 5); @@ -114,7 +114,7 @@ static void AircraftDetailsWndProc(Window *w, WindowEvent *e) int y = 57; do { - if (v->subtype <= 2) { + if (IsNormalAircraft(v)) { SetDParam(0, GetCustomEngineName(v->engine_type)); SetDParam(1, v->build_year); SetDParam(2, v->value); |