From 53d99fff2f2eb6a949bfe1310796760299564489 Mon Sep 17 00:00:00 2001 From: CWXDEV Date: Sat, 30 Dec 2023 15:27:30 +0000 Subject: [PATCH] added test BTR patch, not tested --- project/Aki.Debugging/AkiDebuggingPlugin.cs | 1 + project/Aki.Debugging/Patches/BtrTestPatch.cs | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 project/Aki.Debugging/Patches/BtrTestPatch.cs diff --git a/project/Aki.Debugging/AkiDebuggingPlugin.cs b/project/Aki.Debugging/AkiDebuggingPlugin.cs index 1eaed05..39124e9 100644 --- a/project/Aki.Debugging/AkiDebuggingPlugin.cs +++ b/project/Aki.Debugging/AkiDebuggingPlugin.cs @@ -17,6 +17,7 @@ namespace Aki.Debugging new EndRaidDebug().Enable(); // new CoordinatesPatch().Enable(); // new StaticLootDumper().Enable(); + new BtrTestPatch().Enable(); } catch (Exception ex) { diff --git a/project/Aki.Debugging/Patches/BtrTestPatch.cs b/project/Aki.Debugging/Patches/BtrTestPatch.cs new file mode 100644 index 0000000..4e68ada --- /dev/null +++ b/project/Aki.Debugging/Patches/BtrTestPatch.cs @@ -0,0 +1,43 @@ +using System.Reflection; +using Aki.Reflection.Patching; +using Comfort.Common; +using EFT; +using EFT.UI; + +namespace Aki.Debugging.Patches +{ + public class BtrTestPatch : ModulePatch + { + protected override MethodBase GetTargetMethod() + { + return typeof(GameWorld).GetMethod(nameof(GameWorld.OnGameStarted)); + } + + [PatchPostfix] + public void PostFixPatch() + { + try + { + var gameworld = Singleton.Instance; + var botGame = Singleton.Instance; + + gameworld.BtrController = new GClass2911(); + botGame.BotsController.BotSpawner.SpawnBotBTR(); + + var btrTransform = gameworld.BtrController?.BtrVehicle?.gameObject?.transform; + + if (btrTransform != null) + { + ConsoleScreen.Log($"[AKI-BTR] Btr Location {btrTransform}"); + } else { + ConsoleScreen.Log($"[AKI-BTR] wasnt able to get BTR location"); + } + } + catch (System.Exception) + { + ConsoleScreen.Log("[AKI-BTR] Exception thrown, check logs"); + throw; + } + } + } +} \ No newline at end of file