summaryrefslogtreecommitdiff
path: root/aircraft_gui.c
diff options
context:
space:
mode:
authorrichk <richk@openttd.org>2006-07-19 19:20:04 +0000
committerrichk <richk@openttd.org>2006-07-19 19:20:04 +0000
commit6eda00ed42051a4b4d52fa62d78e8c7b86b18046 (patch)
treec69d0154bcaa252140991424c6c9f6ecf6c2c103 /aircraft_gui.c
parentebef2becafb7465539b4c3a500422c1c29d9f8ec (diff)
downloadopenttd-6eda00ed42051a4b4d52fa62d78e8c7b86b18046.tar.xz
(svn r5519) Fix: Only list helicopters in the new build window of helidepots and helistations.Suggested by peter1138 & Tron.
Demanded under threat of removal by Tron; no thanks given. Last commit from here. Got better things to do with life.
Diffstat (limited to 'aircraft_gui.c')
-rw-r--r--aircraft_gui.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/aircraft_gui.c b/aircraft_gui.c
index 4b988bf8d..a4ead2d52 100644
--- a/aircraft_gui.c
+++ b/aircraft_gui.c
@@ -20,6 +20,7 @@
#include "viewport.h"
#include "player.h"
#include "depot.h"
+#include "airport.h"
#include "vehicle_gui.h"
#include "newgrf_engine.h"
@@ -117,10 +118,13 @@ static void NewAircraftWndProc(Window *w, WindowEvent *e)
int count = 0;
int num = NUM_AIRCRAFT_ENGINES;
const Engine* e = GetEngine(AIRCRAFT_ENGINES_INDEX);
+ EngineID engine_id = AIRCRAFT_ENGINES_INDEX;
do {
- if (HASBIT(e->player_avail, _local_player)) count++;
- } while (++e,--num);
+ if (HASBIT(e->player_avail, _local_player) &&
+ !( (GetAirport(GetStationByTile(w->window_number)->airport_type)->acc_planes == HELICOPTERS_ONLY) &&
+ (AircraftVehInfo(engine_id)->subtype & AIR_CTOL) ) ) count++;
+ } while (++engine_id, ++e,--num);
SetVScrollCount(w, count);
}
@@ -137,7 +141,9 @@ static void NewAircraftWndProc(Window *w, WindowEvent *e)
EngineID selected_id = INVALID_ENGINE;
do {
- if (HASBIT(e->player_avail, _local_player)) {
+ if (HASBIT(e->player_avail, _local_player) &&
+ !( (GetAirport(GetStationByTile(w->window_number)->airport_type)->acc_planes == HELICOPTERS_ONLY) &&
+ (AircraftVehInfo(engine_id)->subtype & AIR_CTOL) ) ) {
if (sel==0) selected_id = engine_id;
if (IS_INT_INSIDE(--pos, -w->vscroll.cap, 0)) {
DrawString(x+62, y+7, GetCustomEngineName(engine_id), sel==0 ? 0xC : 0x10);