mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
Remove GClass Refs for cultist amulet patch
This commit is contained in:
parent
19fe726cea
commit
2ff471e754
@ -14,20 +14,19 @@ namespace Aki.Custom.Patches
|
|||||||
{
|
{
|
||||||
public class CultistAmuletRemovalPatch : ModulePatch
|
public class CultistAmuletRemovalPatch : ModulePatch
|
||||||
{
|
{
|
||||||
//Update GClass ref and Possibly name GClass
|
|
||||||
protected override MethodBase GetTargetMethod()
|
protected override MethodBase GetTargetMethod()
|
||||||
{
|
{
|
||||||
return AccessTools.Method(typeof(CultistEventsClass), nameof(CultistEventsClass.method_4));
|
return AccessTools.Method(typeof(CultistEventsClass), nameof(CultistEventsClass.method_4));
|
||||||
}
|
}
|
||||||
|
|
||||||
[PatchPostfix]
|
[PatchPostfix]
|
||||||
private static void PatchPostfix(ref DamageInfo damageInfo, Player victim)
|
private static void PatchPostfix(DamageInfo damageInfo, Player victim)
|
||||||
{
|
{
|
||||||
var player = damageInfo.Player.iPlayer;
|
var player = damageInfo.Player.iPlayer;
|
||||||
var amulet = damageInfo.Player.iPlayer.FindCultistAmulet();
|
var amulet = player.FindCultistAmulet();
|
||||||
if (victim.Profile.Info.Settings.Role.IsSectant() && amulet != null)
|
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);
|
var amuletslot = list.Single(x => x.ContainedItem == amulet);
|
||||||
amuletslot.RemoveItem();
|
amuletslot.RemoveItem();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user