mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-12 20:30:43 -05:00
Fixed blackscreen on backing out of raid prior to airdrop manager being initialised
Added a lot more nullref checking to patch
This commit is contained in:
parent
be54fe8fd1
commit
5749991b9e
@ -21,22 +21,35 @@ namespace SPT.Custom.Patches
|
|||||||
|
|
||||||
[PatchPrefix]
|
[PatchPrefix]
|
||||||
public static void Prefix()
|
public static void Prefix()
|
||||||
{
|
{
|
||||||
if (Singleton<GameWorld>.Instantiated)
|
if (!Singleton<GameWorld>.Instantiated)
|
||||||
{
|
{
|
||||||
GameWorld gameWorld = Singleton<GameWorld>.Instance;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
List<SynchronizableObject> synchronizableObjectList = Traverse.Create(gameWorld.SynchronizableObjectLogicProcessor).Field<List<SynchronizableObject>>("list_0").Value;
|
GameWorld gameWorld = Singleton<GameWorld>.Instance;
|
||||||
|
if (gameWorld.SynchronizableObjectLogicProcessor is null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (SynchronizableObject obj in synchronizableObjectList)
|
List<SynchronizableObject> syncObjects = Traverse.Create(gameWorld.SynchronizableObjectLogicProcessor)?.Field<List<SynchronizableObject>>("list_0")?.Value;
|
||||||
{
|
if (syncObjects is null)
|
||||||
obj.Logic.ReturnToPool();
|
{
|
||||||
obj.ReturnToPool();
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gameWorld.SynchronizableObjectLogicProcessor.Dispose();
|
foreach (SynchronizableObject obj in syncObjects)
|
||||||
|
{
|
||||||
|
obj.Logic.ReturnToPool();
|
||||||
|
obj.ReturnToPool();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
// Without this check can cause black screen when backing out of raid prior to airdrop manager being init
|
||||||
}
|
if (gameWorld.SynchronizableObjectLogicProcessor.AirdropManager is not null)
|
||||||
|
{
|
||||||
|
gameWorld.SynchronizableObjectLogicProcessor.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user