mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Prevent recursion from causing hard crash
This commit is contained in:
parent
107146f4a7
commit
da199bf90c
@ -245,12 +245,26 @@ namespace NewHorizons.Builder.Body
|
|||||||
cloak._sectors = new Sector[] { sector };
|
cloak._sectors = new Sector[] { sector };
|
||||||
cloak.GetComponent<Renderer>().enabled = true;
|
cloak.GetComponent<Renderer>().enabled = true;
|
||||||
|
|
||||||
// Cull stuff
|
|
||||||
// Do next update so other nodes can be built first
|
// Do next update so other nodes can be built first
|
||||||
Delay.FireOnNextUpdate(() =>
|
Delay.FireOnNextUpdate(() =>
|
||||||
{
|
{
|
||||||
|
// Cull stuff
|
||||||
var cullController = go.AddComponent<BrambleSectorController>();
|
var cullController = go.AddComponent<BrambleSectorController>();
|
||||||
cullController.SetSector(sector);
|
cullController.SetSector(sector);
|
||||||
|
|
||||||
|
// Prevent recursion from causing hard crash
|
||||||
|
foreach (var senderWarp in outerFogWarpVolume._senderWarps)
|
||||||
|
{
|
||||||
|
var currentWarp = senderWarp;
|
||||||
|
while (currentWarp.GetContainerWarpVolume() != null)
|
||||||
|
{
|
||||||
|
if (currentWarp.GetContainerWarpVolume() == outerFogWarpVolume && currentWarp != senderWarp) // game already fixes here to here recursion
|
||||||
|
{
|
||||||
|
outerFogWarpVolume._senderWarps.Remove(senderWarp);
|
||||||
|
}
|
||||||
|
else currentWarp = (InnerFogWarpVolume)currentWarp.GetContainerWarpVolume().GetLinkedFogWarpVolume();
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// finalize
|
// finalize
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user