From 1154611e88a8f43b2577a3878e4b85e0a5e04395 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 22 Aug 2024 09:22:42 +0100 Subject: [PATCH] Removed unnecessary `LabsKeycardRemovalPatch` patch, client now performs this natively --- .../RaidFix/LabsKeycardRemovalPatch.cs | 50 ------------------- .../SPT.SinglePlayer/SPTSingleplayerPlugin.cs | 1 - 2 files changed, 51 deletions(-) delete mode 100644 project/SPT.SinglePlayer/Patches/RaidFix/LabsKeycardRemovalPatch.cs diff --git a/project/SPT.SinglePlayer/Patches/RaidFix/LabsKeycardRemovalPatch.cs b/project/SPT.SinglePlayer/Patches/RaidFix/LabsKeycardRemovalPatch.cs deleted file mode 100644 index 5e3384d..0000000 --- a/project/SPT.SinglePlayer/Patches/RaidFix/LabsKeycardRemovalPatch.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Linq; -using System.Reflection; -using SPT.Reflection.Patching; -using Comfort.Common; -using EFT; -using HarmonyLib; -using EFT.InventoryLogic; - -namespace SPT.SinglePlayer.Patches.RaidFix -{ - /// - /// Patch to remove the Labs Access Card from player inventory upon entering Labs - /// - public class LabsKeycardRemovalPatch : ModulePatch - { - private const string LabsAccessCardTemplateId = "5c94bbff86f7747ee735c08f"; - - protected override MethodBase GetTargetMethod() - { - return AccessTools.Method(typeof(GameWorld), nameof(GameWorld.OnGameStarted)); - } - - [PatchPostfix] - public static void PatchPostfix() - { - var gameWorld = Singleton.Instance; - var player = gameWorld?.MainPlayer; - - if (gameWorld == null || player == null) - { - return; - } - - if (gameWorld.MainPlayer.Location.ToLower() != "laboratory") - { - return; - } - - var accessCardItem = player.Profile.Inventory.AllRealPlayerItems.FirstOrDefault(x => x.TemplateId == LabsAccessCardTemplateId); - - if (accessCardItem == null) - { - return; - } - - var inventoryController = Traverse.Create(player).Field("_inventoryController").Value; - InteractionsHandlerClass.Remove(accessCardItem, inventoryController); - } - } -} \ No newline at end of file diff --git a/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs b/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs index 29d3c9d..363f220 100644 --- a/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs +++ b/project/SPT.SinglePlayer/SPTSingleplayerPlugin.cs @@ -46,7 +46,6 @@ namespace SPT.SinglePlayer new LoadOfflineRaidScreenPatch().Enable(); new PluginErrorNotifierPatch().Enable(); new GetNewBotTemplatesPatch().Enable(); - new LabsKeycardRemovalPatch().Enable(); new MapReadyButtonPatch().Enable(); new RemoveUsedBotProfilePatch().Enable(); new ScavLateStartPatch().Enable();