Codechange: strongly type VehicleID

This commit is contained in:
Rubidium
2025-02-02 10:41:00 +01:00
committed by rubidium42
parent 1003967267
commit 70c9f3963c
15 changed files with 31 additions and 33 deletions

View File

@@ -44,7 +44,7 @@ ScriptVehicleList_Station::ScriptVehicleList_Station(StationID station_id)
FindVehiclesWithOrder(
[is_deity, owner](const Vehicle *v) { return is_deity || v->owner == owner; },
[station_id](const Order *order) { return (order->IsType(OT_GOTO_STATION) || order->IsType(OT_GOTO_WAYPOINT)) && order->GetDestination() == station_id; },
[this](const Vehicle *v) { this->AddItem(v->index); }
[this](const Vehicle *v) { this->AddItem(v->index.base()); }
);
}
@@ -91,7 +91,7 @@ ScriptVehicleList_Depot::ScriptVehicleList_Depot(TileIndex tile)
FindVehiclesWithOrder(
[is_deity, owner, type](const Vehicle *v) { return (is_deity || v->owner == owner) && v->type == type; },
[dest](const Order *order) { return order->IsType(OT_GOTO_DEPOT) && order->GetDestination() == dest; },
[this](const Vehicle *v) { this->AddItem(v->index); }
[this](const Vehicle *v) { this->AddItem(v->index.base()); }
);
}
@@ -100,7 +100,7 @@ ScriptVehicleList_SharedOrders::ScriptVehicleList_SharedOrders(VehicleID vehicle
if (!ScriptVehicle::IsPrimaryVehicle(vehicle_id)) return;
for (const Vehicle *v = Vehicle::Get(vehicle_id)->FirstShared(); v != nullptr; v = v->NextShared()) {
this->AddItem(v->index);
this->AddItem(v->index.base());
}
}