mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
29 lines
743 B
C#
29 lines
743 B
C#
using Aki.Reflection.Patching;
|
|
using Comfort.Common;
|
|
using EFT;
|
|
using EFT.Airdrop;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
|
|
namespace Aki.Custom.Airdrops.Patches
|
|
{
|
|
public class AirdropPatch : ModulePatch
|
|
{
|
|
protected override MethodBase GetTargetMethod()
|
|
{
|
|
return typeof(GameWorld).GetMethod(nameof(GameWorld.OnGameStarted));
|
|
}
|
|
|
|
[PatchPostfix]
|
|
public static void PatchPostFix()
|
|
{
|
|
var gameWorld = Singleton<GameWorld>.Instance;
|
|
var points = LocationScene.GetAll<AirdropPoint>().Any();
|
|
|
|
if (gameWorld != null && points)
|
|
{
|
|
gameWorld.gameObject.AddComponent<AirdropsManager>();
|
|
}
|
|
}
|
|
}
|
|
} |