summaryrefslogtreecommitdiff
path: root/ship_gui.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2005-01-15 19:06:22 +0000
committertruelight <truelight@openttd.org>2005-01-15 19:06:22 +0000
commitd275109e79c191dde34b71f07e5a39cfeb11fba7 (patch)
tree86e7a6e69dee1414ae1e88cfceffd93f1b28ded2 /ship_gui.c
parent732c362deaaa9b6a817a2e82c45d88e33f8f1e90 (diff)
downloadopenttd-d275109e79c191dde34b71f07e5a39cfeb11fba7.tar.xz
(svn r1525) -Codechange: rewrote the _order_array, now it can be made dynamic.
-Codechange: renamed all 'schedule' stuff to 'order(list)' -Codechange: moved all order-stuff to order_cmd.c / order.h -Codechange: vehicles that share orders are now linked to eachother with next_shared/prev_shared in Vehicle Developers: please use AssignOrder to assign data to an order. If not, you _WILL_ make the save-routine to assert!
Diffstat (limited to 'ship_gui.c')
-rw-r--r--ship_gui.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/ship_gui.c b/ship_gui.c
index f7c54a10f..92b6cffd0 100644
--- a/ship_gui.c
+++ b/ship_gui.c
@@ -863,15 +863,14 @@ void ShowShipDepotWindow(uint tile)
}
-static void DrawSmallShipSchedule(Vehicle *v, int x, int y) {
- Order *sched;
- int sel;
- Station *st;
- int i = 0;
+static void DrawSmallOrderList(Vehicle *v, int x, int y) {
+ const Order *order;
+ int sel, i = 0;
sel = v->cur_order_index;
+ order = v->orders;
- for (sched = v->schedule_ptr; sched->type != OT_NOTHING; ++sched) {
+ while (order != NULL) {
if (sel == 0) {
_stringwidth_base = 0xE0;
DoDrawString( "\xAF", x-6, y, 16);
@@ -879,11 +878,9 @@ static void DrawSmallShipSchedule(Vehicle *v, int x, int y) {
}
sel--;
- if (sched->type == OT_GOTO_STATION) {
- st = GetStation(sched->station);
-
- if (!(st->had_vehicle_of_type & HVOT_BUOY)) {
- SetDParam(0, sched->station);
+ if (order->type == OT_GOTO_STATION) {
+ if (!(GetStation(order->station)->had_vehicle_of_type & HVOT_BUOY)) {
+ SetDParam(0, order->station);
DrawString(x, y, STR_A036, 0);
y += 6;
@@ -891,6 +888,8 @@ static void DrawSmallShipSchedule(Vehicle *v, int x, int y) {
break;
}
}
+
+ order = order->next;
}
}
@@ -998,7 +997,7 @@ static void PlayerShipsWndProc(Window *w, WindowEvent *e)
DrawString(x + 12, y, STR_01AB, 0);
}
- DrawSmallShipSchedule(v, x + 138, y);
+ DrawSmallOrderList(v, x + 138, y);
y += PLY_WND_PRC__SIZE_OF_ROW_BIG;
}