mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 06:10:45 -05:00
* Fix airspace congested spam by disposing of the Server airdrop manager as well * Add patch to dispose of flares correctly * Spacing fixes
34 lines
815 B
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|