1
Fork 0
mirror of https://github.com/thegeneralist01/Scene-Manager-DevRepo synced 2026-01-10 15:20:29 +01:00

Attempted to fix modified collection crash in waypoint collection loop

This commit is contained in:
Rich Dunne 2021-05-23 06:42:33 -06:00
parent 84223508cb
commit 4ee9d1e3da

View file

@ -239,9 +239,9 @@ namespace SceneManager.Paths
var collectorWaypoints = Waypoints.Where(x => x.IsCollector);
var vehiclesInWorld = World.GetAllVehicles().Where(x => x);
foreach (Waypoint waypoint in collectorWaypoints)
foreach (Waypoint waypoint in collectorWaypoints.ToList())
{
foreach (Vehicle vehicle in vehiclesInWorld)
foreach (Vehicle vehicle in vehiclesInWorld.ToList())
{
if (vehicle.IsNearCollectorWaypoint(waypoint) && vehicle.IsValidForPathCollection(this))
{