summaryrefslogtreecommitdiff
path: root/aircraft_gui.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-06-05 12:43:41 +0000
committertron <tron@openttd.org>2006-06-05 12:43:41 +0000
commit098e54f7d9905b5d33f0e13a9a9d6209d5dfea50 (patch)
tree71115f6bacc228220f52537dbab8c6154497e86a /aircraft_gui.c
parent6d135c110002729acd0800fa4ffe6750a3132f27 (diff)
downloadopenttd-098e54f7d9905b5d33f0e13a9a9d6209d5dfea50.tar.xz
(svn r5124) Add IsAircraftInHangar{Stopped,}(), which supersedes CheckStoppedInHangar()
-Fix: Be more strict what it means for an aircraft to be in a hangar: It's not just being stopped on a hangar tile
Diffstat (limited to 'aircraft_gui.c')
-rw-r--r--aircraft_gui.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/aircraft_gui.c b/aircraft_gui.c
index 59c7b7c13..51695618f 100644
--- a/aircraft_gui.c
+++ b/aircraft_gui.c
@@ -2,6 +2,7 @@
#include "stdafx.h"
#include "openttd.h"
+#include "aircraft.h"
#include "debug.h"
#include "functions.h"
#include "station_map.h"
@@ -492,7 +493,6 @@ static const Widget _aircraft_view_widgets[] = {
{ WIDGETS_END }
};
-bool CheckStoppedInHangar(const Vehicle* v); /* XXX extern function declaration in .c */
static void AircraftViewWndProc(Window *w, WindowEvent *e)
{
@@ -502,7 +502,7 @@ static void AircraftViewWndProc(Window *w, WindowEvent *e)
uint32 disabled = 1 << 8;
StringID str;
- if (v->vehstatus & VS_STOPPED && IsHangarTile(v->tile)) disabled = 0;
+ if (IsAircraftInHangarStopped(v)) disabled = 0;
if (v->owner != _local_player) disabled |= 1 << 8 | 1 << 7;
w->disabled_state = disabled;
@@ -595,7 +595,7 @@ static void AircraftViewWndProc(Window *w, WindowEvent *e)
case WE_MOUSELOOP: {
const Vehicle* v = GetVehicle(w->window_number);
- uint32 h = CheckStoppedInHangar(v) ? (1 << 7) : (1 << 11);
+ uint32 h = IsAircraftInHangarStopped(v) ? 1 << 7 : 1 << 11;
if (h != w->hidden_state) {
w->hidden_state = h;
@@ -1027,7 +1027,7 @@ static void PlayerAircraftWndProc(Window *w, WindowEvent *e)
DrawVehicleProfitButton(v, x, y + 13);
SetDParam(0, v->unitnumber);
- if (IsHangarTile(v->tile) && v->vehstatus & VS_HIDDEN) {
+ if (IsAircraftInHangar(v)) {
str = STR_021F;
} else {
str = v->age > v->max_age - 366 ? STR_00E3 : STR_00E2;