mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-12 20:50:44 -05:00
Removed unnecessary LabsKeycardRemovalPatch
patch, client now performs this natively
This commit is contained in:
parent
fd52b7386a
commit
1154611e88
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user