mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Remove outside foreach
This commit is contained in:
parent
0fbe807589
commit
32923cea52
@ -253,6 +253,7 @@ namespace NewHorizons.Builder.Body
|
||||
cullController.SetSector(sector);
|
||||
|
||||
// Prevent recursion from causing hard crash
|
||||
List<InnerFogWarpVolume> removeList = new List<InnerFogWarpVolume>();
|
||||
foreach (var senderWarp in outerFogWarpVolume._senderWarps)
|
||||
{
|
||||
var currentWarp = senderWarp;
|
||||
@ -260,10 +261,15 @@ namespace NewHorizons.Builder.Body
|
||||
{
|
||||
if (currentWarp.GetContainerWarpVolume() == outerFogWarpVolume && currentWarp != senderWarp) // game already fixes here to here recursion
|
||||
{
|
||||
outerFogWarpVolume._senderWarps.Remove(senderWarp); break;
|
||||
removeList.Add(senderWarp); break;
|
||||
}
|
||||
else currentWarp = (InnerFogWarpVolume)currentWarp.GetContainerWarpVolume().GetLinkedFogWarpVolume();
|
||||
}
|
||||
|
||||
}
|
||||
foreach (var recursiveWarp in removeList)
|
||||
{
|
||||
outerFogWarpVolume._senderWarps.Remove(recursiveWarp);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user