mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 01:30: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
@ -8,19 +8,19 @@ using Comfort.Common;
|
|||||||
|
|
||||||
namespace SPT.Custom.Patches
|
namespace SPT.Custom.Patches
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This patch prevents the crashing that was caused by the airdrop since the mortar event, it fully unloads whatever synchronized objects
|
/// This patch prevents the crashing that was caused by the airdrop since the mortar event, it fully unloads whatever synchronized objects
|
||||||
/// Are still loaded before unused resources are cleaned up (Which causes this crash)
|
/// Are still loaded before unused resources are cleaned up (Which causes this crash)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class FixAirdropCrashPatch : ModulePatch
|
public class FixAirdropCrashPatch : ModulePatch
|
||||||
{
|
{
|
||||||
protected override MethodBase GetTargetMethod()
|
protected override MethodBase GetTargetMethod()
|
||||||
{
|
{
|
||||||
return typeof(TarkovApplication).GetMethod(nameof(TarkovApplication.method_48));
|
return typeof(TarkovApplication).GetMethod(nameof(TarkovApplication.method_48));
|
||||||
}
|
}
|
||||||
|
|
||||||
[PatchPrefix]
|
[PatchPrefix]
|
||||||
public static void Prefix()
|
public static void Prefix()
|
||||||
{
|
{
|
||||||
if (!Singleton<GameWorld>.Instantiated)
|
if (!Singleton<GameWorld>.Instantiated)
|
||||||
{
|
{
|
||||||
@ -48,8 +48,13 @@ namespace SPT.Custom.Patches
|
|||||||
// Without this check can cause black screen when backing out of raid prior to airdrop manager being init
|
// 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.AirdropManager is not null)
|
||||||
{
|
{
|
||||||
|
if (gameWorld.SynchronizableObjectLogicProcessor is SynchronizableObjectLogicProcessorClass synchronizableObjectLogicProcessorClass)
|
||||||
|
{
|
||||||
|
synchronizableObjectLogicProcessorClass.ServerAirdropManager.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
gameWorld.SynchronizableObjectLogicProcessor.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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -38,14 +38,15 @@ namespace SPT.Custom
|
|||||||
new BotDifficultyPatch().Enable();
|
new BotDifficultyPatch().Enable();
|
||||||
new VersionLabelPatch().Enable();
|
new VersionLabelPatch().Enable();
|
||||||
new FixScavWarNullErrorWithMarkOfUnknownPatch().Enable();
|
new FixScavWarNullErrorWithMarkOfUnknownPatch().Enable();
|
||||||
new MergeScavPmcQuestsOnInventoryLoadPatch().Enable();
|
new MergeScavPmcQuestsOnInventoryLoadPatch().Enable();
|
||||||
new CopyPmcQuestsToPlayerScavPatch().Enable();
|
new CopyPmcQuestsToPlayerScavPatch().Enable();
|
||||||
new FixBossesHavingNoFollowersOnMediumAiAmount().Enable();
|
new FixBossesHavingNoFollowersOnMediumAiAmount().Enable();
|
||||||
new FixAirdropCrashPatch().Enable();
|
new FixAirdropCrashPatch().Enable();
|
||||||
//new AllowAirdropsInPvEPatch().Enable();
|
new FixAirdropFlareDisposePatch().Enable();
|
||||||
|
//new AllowAirdropsInPvEPatch().Enable();
|
||||||
new MemoryCollectionPatch().Enable();
|
new MemoryCollectionPatch().Enable();
|
||||||
|
|
||||||
HookObject.AddOrGetComponent<MenuNotificationManager>();
|
HookObject.AddOrGetComponent<MenuNotificationManager>();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user