mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
35 lines
853 B
C#
35 lines
853 B
C#
|
using Aki.Reflection.Patching;
|
|||
|
using Comfort.Common;
|
|||
|
using EFT;
|
|||
|
using HarmonyLib;
|
|||
|
using System.Reflection;
|
|||
|
|
|||
|
namespace Aki.Custom.BTR.Patches
|
|||
|
{
|
|||
|
public class BTRSpawnBotAtRaidStartPatch : ModulePatch
|
|||
|
{
|
|||
|
protected override MethodBase GetTargetMethod()
|
|||
|
{
|
|||
|
return AccessTools.Method(typeof(GameWorld), nameof(GameWorld.OnGameStarted));
|
|||
|
}
|
|||
|
|
|||
|
[PatchPostfix]
|
|||
|
private static void PatchPostfix(GameWorld __instance)
|
|||
|
{
|
|||
|
var btrManager = __instance.GetComponent<BTRManager>();
|
|||
|
if (btrManager == null)
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
var botGame = Singleton<IBotGame>.Instance;
|
|||
|
if (botGame == null)
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
botGame.BotsController.BotSpawner.SpawnBotBTR();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|