mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
Honestly this is just a shot in the dark hotfix. I've tested it and these changes still work fine for me. Let me know if this fixes the BTR not working, Chomp Reviewed-on: SPT-AKI/Modules#69 Co-authored-by: Arys <arys@noreply.dev.sp-tarkov.com> Co-committed-by: Arys <arys@noreply.dev.sp-tarkov.com>
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();
|
|
}
|
|
}
|
|
}
|