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

Remove GClass Refs for cultist amulet patch

This commit is contained in:
Kaeno 2024-02-28 20:34:15 +00:00
parent 19fe726cea
commit 2ff471e754

View File

@ -14,20 +14,19 @@ namespace Aki.Custom.Patches
{
public class CultistAmuletRemovalPatch : ModulePatch
{
//Update GClass ref and Possibly name GClass
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(CultistEventsClass), nameof(CultistEventsClass.method_4));
}
[PatchPostfix]
private static void PatchPostfix(ref DamageInfo damageInfo, Player victim)
private static void PatchPostfix(DamageInfo damageInfo, Player victim)
{
var player = damageInfo.Player.iPlayer;
var amulet = damageInfo.Player.iPlayer.FindCultistAmulet();
var amulet = player.FindCultistAmulet();
if (victim.Profile.Info.Settings.Role.IsSectant() && amulet != null)
{
var list = (player.Profile.Inventory.Equipment.GetSlot(EquipmentSlot.Pockets).ContainedItem as GClass2683).Slots;
var list = (player.Profile.Inventory.Equipment.GetSlot(EquipmentSlot.Pockets).ContainedItem as SearchableItemClass).Slots;
var amuletslot = list.Single(x => x.ContainedItem == amulet);
amuletslot.RemoveItem();
}