From 5e96656c1e2e810b72ba5e66ced1005c9cc70840 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 11 Jul 2024 10:49:27 +0100 Subject: [PATCH] Rename patches to improve clarity --- ...DataTryCallPatch.cs => AddEnemyTryCallFailureFixPatch.cs} | 2 +- ...BotPatch.cs => BotCallForHelpWrongTargetLocationPatch.cs} | 5 ++--- project/SPT.Custom/SPTCustomPlugin.cs | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) rename project/SPT.Custom/Patches/{BotCalledDataTryCallPatch.cs => AddEnemyTryCallFailureFixPatch.cs} (95%) rename project/SPT.Custom/Patches/{BotCallForHelpCallBotPatch.cs => BotCallForHelpWrongTargetLocationPatch.cs} (94%) diff --git a/project/SPT.Custom/Patches/BotCalledDataTryCallPatch.cs b/project/SPT.Custom/Patches/AddEnemyTryCallFailureFixPatch.cs similarity index 95% rename from project/SPT.Custom/Patches/BotCalledDataTryCallPatch.cs rename to project/SPT.Custom/Patches/AddEnemyTryCallFailureFixPatch.cs index 5a8ba51..c164c30 100644 --- a/project/SPT.Custom/Patches/BotCalledDataTryCallPatch.cs +++ b/project/SPT.Custom/Patches/AddEnemyTryCallFailureFixPatch.cs @@ -9,7 +9,7 @@ namespace SPT.Custom.Patches * It's possible for `AddEnemy` to return false, in that case, further code in TryCall will fail, * so we do the first bit of `TryCall` ourselves, and skip the original function if AddEnemy fails */ - internal class BotCalledDataTryCallPatch : ModulePatch + public class AddEnemyTryCallFailureFixPatch : ModulePatch { protected override MethodBase GetTargetMethod() { diff --git a/project/SPT.Custom/Patches/BotCallForHelpCallBotPatch.cs b/project/SPT.Custom/Patches/BotCallForHelpWrongTargetLocationPatch.cs similarity index 94% rename from project/SPT.Custom/Patches/BotCallForHelpCallBotPatch.cs rename to project/SPT.Custom/Patches/BotCallForHelpWrongTargetLocationPatch.cs index e0a2cae..866a4de 100644 --- a/project/SPT.Custom/Patches/BotCallForHelpCallBotPatch.cs +++ b/project/SPT.Custom/Patches/BotCallForHelpWrongTargetLocationPatch.cs @@ -12,7 +12,7 @@ namespace SPT.Custom.Patches * * This results in both an NRE, and the called bots target location being wrong */ - internal class BotCallForHelpCallBotPatch : ModulePatch + public class BotCallForHelpWrongTargetLocationPatch : ModulePatch { private static FieldInfo _originalPanicTypeField; @@ -47,8 +47,7 @@ namespace SPT.Custom.Patches __result = false; } - // Skip original - return false; + return false; // Skip original } } } diff --git a/project/SPT.Custom/SPTCustomPlugin.cs b/project/SPT.Custom/SPTCustomPlugin.cs index 642e87e..bcbaae6 100644 --- a/project/SPT.Custom/SPTCustomPlugin.cs +++ b/project/SPT.Custom/SPTCustomPlugin.cs @@ -23,8 +23,8 @@ namespace SPT.Custom new EasyBundlePatch().Enable(); // TODO: check if these patches are needed - new BotCalledDataTryCallPatch().Enable(); - new BotCallForHelpCallBotPatch().Enable(); + new AddEnemyTryCallFailureFixPatch().Enable(); + new BotCallForHelpWrongTargetLocationPatch().Enable(); new BotOwnerDisposePatch().Enable(); new BotsGroupLetBossesShootPmcsPatch().Enable(); new AddEnemyToAllGroupsInBotZonePatch().Enable();