From 2d2b4fb78fc97027cb60eeefd4507704167e17ad Mon Sep 17 00:00:00 2001 From: Arys Date: Mon, 29 Jan 2024 18:08:45 +0000 Subject: [PATCH] Removed unnecessary BTR patch (!70) Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Modules/pulls/70 Co-authored-by: Arys Co-committed-by: Arys --- project/Aki.Custom/AkiCustomPlugin.cs | 1 - project/Aki.Custom/BTR/BTRManager.cs | 1 + .../Patches/BTRSpawnBotAtRaidStartPatch.cs | 34 ------------------- 3 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 project/Aki.Custom/BTR/Patches/BTRSpawnBotAtRaidStartPatch.cs diff --git a/project/Aki.Custom/AkiCustomPlugin.cs b/project/Aki.Custom/AkiCustomPlugin.cs index 05c3739..20b240f 100644 --- a/project/Aki.Custom/AkiCustomPlugin.cs +++ b/project/Aki.Custom/AkiCustomPlugin.cs @@ -61,7 +61,6 @@ namespace Aki.Custom new BTRTurretDefaultAimingPositionPatch().Enable(); new BTRIsDoorsClosedPath().Enable(); new BTRPatch().Enable(); - new BTRSpawnBotAtRaidStartPatch().Enable(); new BTRTransferItemsPatch().Enable(); new BTREndRaidItemDeliveryPatch().Enable(); new BTRDestroyAtRaidEndPatch().Enable(); diff --git a/project/Aki.Custom/BTR/BTRManager.cs b/project/Aki.Custom/BTR/BTRManager.cs index 0368846..e23b216 100644 --- a/project/Aki.Custom/BTR/BTRManager.cs +++ b/project/Aki.Custom/BTR/BTRManager.cs @@ -161,6 +161,7 @@ namespace Aki.Custom.BTR var botsController = Singleton.Instance.BotsController; btrBotService = botsController.BotTradersServices.BTRServices; btrController.method_3(); // spawns server-side BTR game object + botsController.BotSpawner.SpawnBotBTR(); // spawns the scav bot which controls the BTR's turret // Initial BTR configuration btrServerSide = btrController.BtrVehicle; diff --git a/project/Aki.Custom/BTR/Patches/BTRSpawnBotAtRaidStartPatch.cs b/project/Aki.Custom/BTR/Patches/BTRSpawnBotAtRaidStartPatch.cs deleted file mode 100644 index ea0ad49..0000000 --- a/project/Aki.Custom/BTR/Patches/BTRSpawnBotAtRaidStartPatch.cs +++ /dev/null @@ -1,34 +0,0 @@ -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(); - if (btrManager == null) - { - return; - } - - var botGame = Singleton.Instance; - if (botGame == null) - { - return; - } - - botGame.BotsController.BotSpawner.SpawnBotBTR(); - } - } -}