diff options
author | truelight <truelight@openttd.org> | 2005-01-15 19:06:22 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2005-01-15 19:06:22 +0000 |
commit | d275109e79c191dde34b71f07e5a39cfeb11fba7 (patch) | |
tree | 86e7a6e69dee1414ae1e88cfceffd93f1b28ded2 /ai_new.c | |
parent | 732c362deaaa9b6a817a2e82c45d88e33f8f1e90 (diff) | |
download | openttd-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 'ai_new.c')
-rw-r--r-- | ai_new.c | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -502,14 +502,12 @@ static bool AiNew_CheckVehicleStation(Player *p, Station *st) { // Also check if we don't have already a lot of busses to this city... FOR_ALL_VEHICLES(v) { if (v->owner == _current_player) { - const Order *sched = v->schedule_ptr; - if (sched != NULL) { - for (; sched->type != OT_NOTHING; ++sched) { - if (sched->type == OT_GOTO_STATION && - GetStation(sched->station) == st) { - // This vehicle has this city in his list - count++; - } + const Order *order; + + FOR_VEHICLE_ORDERS(v, order) { + if (order->type == OT_GOTO_STATION && GetStation(order->station) == st) { + // This vehicle has this city in its list + count++; } } } |