Codechange: Move ownership of Orders to OrderList. (#13948)

Removes the orders pool, and orders are now stored directly in each OrderList.

Iterating orders now no longer needs to traverse a linked-list, all orders in an OrderList are sequential.
This commit is contained in:
Peter Nelson
2025-05-23 10:36:28 +01:00
committed by GitHub
parent 7344dfe651
commit 0455627d16
30 changed files with 602 additions and 652 deletions

View File

@@ -479,7 +479,8 @@ void UpdateVehicleTimetable(Vehicle *v, bool travelling)
assert(real_current_order != nullptr);
VehicleOrderID first_manual_order = 0;
for (Order *o = v->GetFirstOrder(); o != nullptr && o->IsType(OT_IMPLICIT); o = o->next) {
for (const Order &o : v->Orders()) {
if (!o.IsType(OT_IMPLICIT)) break;
++first_manual_order;
}