mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Check for null refs inside streaming warp volume then destroy it
This commit is contained in:
parent
0036028404
commit
e8b0bf4a6b
@ -1,3 +1,4 @@
|
||||
using NewHorizons.Utility.OWML;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Components.Volumes
|
||||
@ -23,6 +24,23 @@ namespace NewHorizons.Components.Volumes
|
||||
|
||||
public void FixedUpdate()
|
||||
{
|
||||
// Bug report on Astral Codec mod page - Huge lag inside streaming warp volume, possible NRE?
|
||||
if (_probe == null)
|
||||
{
|
||||
_probe = Locator.GetProbe();
|
||||
if (_probe == null)
|
||||
{
|
||||
NHLogger.LogError($"How is your scout probe null? Destroying {nameof(StreamingWarpVolume)}");
|
||||
Component.DestroyImmediate(this);
|
||||
}
|
||||
}
|
||||
|
||||
if (streamingGroup == null)
|
||||
{
|
||||
NHLogger.LogError($"{nameof(StreamingWarpVolume)} has no streaming group. Destroying {nameof(StreamingWarpVolume)}");
|
||||
Component.DestroyImmediate(this);
|
||||
}
|
||||
|
||||
bool probeActive = _probe.IsLaunched() && !_probe.IsAnchored();
|
||||
|
||||
bool shouldBeLoadingRequiredAssets = _playerInVolume || (_probeInVolume && probeActive);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user