0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 01:50:45 -05:00

Removed unnecessary LabsKeycardRemovalPatch patch, client now performs this natively

This commit is contained in:
Dev 2024-08-22 09:22:42 +01:00
parent fd52b7386a
commit 1154611e88
2 changed files with 0 additions and 51 deletions

View File

@ -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
{
/// <summary>
/// Patch to remove the Labs Access Card from player inventory upon entering Labs
/// </summary>
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<GameWorld>.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>("_inventoryController").Value;
InteractionsHandlerClass.Remove(accessCardItem, inventoryController);
}
}
}

View File

@ -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();