- Code: Select all
Collection was modified; enumeration operation may not execute.
First seen 18 hours ago, latest 43 minutes ago. (Delete 2 errors)
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at System.Collections.Generic.List`1.Enumerator.MoveNext()
- Code: Select all
private Unit FindNearestInRangeTarget()
{
Unit nearestTarget = null;
lock (g.unitManager.unitListLock)
{
foreach (Unit u in g.unitManager.units)
{
SetNearestTarget(u, nearestTarget, out nearestTarget);
}
}
return nearestTarget;
}