0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 08:50:43 -05:00
modules/project/SPT.Custom/Patches/FixAirdropFlareDisposePatch.cs
2025-01-30 12:18:13 +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(GClass2458).GetMethod(nameof(GClass2458.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);
}
}
}
}