mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-18 01:42:38 +01:00
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:
@@ -2735,14 +2735,14 @@ int WhoCanServiceIndustry(Industry *ind)
|
||||
* We cannot check the first of shared orders only, since the first vehicle in such a chain
|
||||
* may have a different cargo type.
|
||||
*/
|
||||
for (const Order *o : v->Orders()) {
|
||||
if (o->IsType(OT_GOTO_STATION) && !(o->GetUnloadType() & OUFB_TRANSFER)) {
|
||||
for (const Order &o : v->Orders()) {
|
||||
if (o.IsType(OT_GOTO_STATION) && !(o.GetUnloadType() & OUFB_TRANSFER)) {
|
||||
/* Vehicle visits a station to load or unload */
|
||||
Station *st = Station::Get(o->GetDestination().ToStationID());
|
||||
Station *st = Station::Get(o.GetDestination().ToStationID());
|
||||
assert(st != nullptr);
|
||||
|
||||
/* Same cargo produced by industry is dropped here => not serviced by vehicle v */
|
||||
if ((o->GetUnloadType() & OUFB_UNLOAD) && !c_accepts) break;
|
||||
if ((o.GetUnloadType() & OUFB_UNLOAD) && !c_accepts) break;
|
||||
|
||||
if (ind->stations_near.find(st) != ind->stations_near.end()) {
|
||||
if (v->owner == _local_company) return 2; // Company services industry
|
||||
|
||||
Reference in New Issue
Block a user