diff options
author | tron <tron@openttd.org> | 2004-12-05 12:43:04 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2004-12-05 12:43:04 +0000 |
commit | 7c2448ecea6ec47f9df4928ad3f42668936835ee (patch) | |
tree | f4ed902f473744cc8497d09b3f372d3da1524f4f /aircraft_gui.c | |
parent | 1de8e294d892a70edbd1f4f3d3a6a141711f6648 (diff) | |
download | openttd-7c2448ecea6ec47f9df4928ad3f42668936835ee.tar.xz |
(svn r955) Replace uint16 for orders with struct Order
This adds no functionality, but is a stepping stone for future improvement (like 16bit order indices) and is easier to read.
This changes preserves binary compatibility wrt savegames.
Diffstat (limited to 'aircraft_gui.c')
-rw-r--r-- | aircraft_gui.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/aircraft_gui.c b/aircraft_gui.c index a92e175b4..cfe1b7238 100644 --- a/aircraft_gui.c +++ b/aircraft_gui.c @@ -547,15 +547,15 @@ static void AircraftViewWndProc(Window *w, WindowEvent *e) } else if (v->vehstatus & VS_STOPPED) { str = STR_8861_STOPPED; } else { - switch(v->next_order & OT_MASK) { + switch (v->current_order.type) { case OT_GOTO_STATION: { - SetDParam(0, v->next_order_param); + SetDParam(0, v->current_order.station); SetDParam(1, v->cur_speed * 8); str = STR_HEADING_FOR_STATION + _patches.vehicle_speed; } break; case OT_GOTO_DEPOT: { - SetDParam(0, v->next_order_param); + SetDParam(0, v->current_order.station); SetDParam(1, v->cur_speed * 8); str = STR_HEADING_FOR_HANGAR + _patches.vehicle_speed; } break; @@ -857,15 +857,15 @@ void ShowAircraftDepotWindow(uint tile) } static void DrawSmallSchedule(Vehicle *v, int x, int y) { - uint16 *sched; + const Order *sched; int sel; - uint ord; + Order ord; int i = 0; sched = v->schedule_ptr; sel = v->cur_order_index; - while ((ord=*sched++) != 0) { + while ((ord = *sched++).type != OT_NOTHING) { if (sel == 0) { _stringwidth_base = 0xE0; DoDrawString( "\xAF", x-6, y, 16); @@ -873,8 +873,8 @@ static void DrawSmallSchedule(Vehicle *v, int x, int y) { } sel--; - if ((ord & OT_MASK) == OT_GOTO_STATION) { - SetDParam(0, ord >> 8); + if (ord.type == OT_GOTO_STATION) { + SetDParam(0, ord.station); DrawString(x, y, STR_A036, 0); y += 6; |