mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-12 21:10:45 -05:00
Add further fixes to the airdop (#2)
* Fix airspace congested spam by disposing of the Server airdrop manager as well * Add patch to dispose of flares correctly * Spacing fixes
This commit is contained in:
parent
5749991b9e
commit
fa9e6ce35f
@ -48,6 +48,11 @@ namespace SPT.Custom.Patches
|
||||
// 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)
|
||||
{
|
||||
if (gameWorld.SynchronizableObjectLogicProcessor is SynchronizableObjectLogicProcessorClass synchronizableObjectLogicProcessorClass)
|
||||
{
|
||||
synchronizableObjectLogicProcessorClass.ServerAirdropManager.Dispose();
|
||||
}
|
||||
|
||||
gameWorld.SynchronizableObjectLogicProcessor.Dispose();
|
||||
}
|
||||
}
|
||||
|
33
project/SPT.Custom/Patches/FixAirdropFlareDisposePatch.cs
Normal file
33
project/SPT.Custom/Patches/FixAirdropFlareDisposePatch.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using SPT.Reflection.Patching;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SPT.Custom.Patches
|
||||
{
|
||||
/// <summary>
|
||||
/// This patch prevents the weird pink smoke / flares that are still in the sky the next raid if a player has just extracted
|
||||
/// while the airplane is dropping a crate
|
||||
/// </summary>
|
||||
public class FixAirdropFlareDisposePatch : ModulePatch
|
||||
{
|
||||
protected override MethodBase GetTargetMethod()
|
||||
{
|
||||
return typeof(GClass2408).GetMethod(nameof(GClass2408.Dispose));
|
||||
}
|
||||
|
||||
[PatchPrefix]
|
||||
public static void Prefix(Dictionary<GameObject, float> ___dictionary_0)
|
||||
{
|
||||
if (___dictionary_0 == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (KeyValuePair<GameObject, float> keyValuePair in ___dictionary_0)
|
||||
{
|
||||
Object.Destroy(keyValuePair.Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -42,6 +42,7 @@ namespace SPT.Custom
|
||||
new CopyPmcQuestsToPlayerScavPatch().Enable();
|
||||
new FixBossesHavingNoFollowersOnMediumAiAmount().Enable();
|
||||
new FixAirdropCrashPatch().Enable();
|
||||
new FixAirdropFlareDisposePatch().Enable();
|
||||
//new AllowAirdropsInPvEPatch().Enable();
|
||||
new MemoryCollectionPatch().Enable();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user