0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 05:50:44 -05:00
modules/project/SPT.Custom/Patches/FixAirdropFlareDisposePatch.cs
Jesse fa9e6ce35f
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
2024-11-25 14:47:31 +00:00

34 lines
815 B
C#

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);
}
}
}
}