private static void CharacterBody_OnEquipmentLost(On.RoR2.CharacterBody.orig_OnEquipmentLost orig, CharacterBody self, EquipmentDef equipmentDef) { orig(self, equipmentDef); if (equipmentDef.equipmentIndex == _equipIndex) { self.RemoveBuff(_buffIndex); } }
public static void CharacterBody_OnEquipmentLost(On.RoR2.CharacterBody.orig_OnEquipmentLost orig, CharacterBody self, EquipmentDef equipmentDef) { if (self.masterObject && self.masterObject.GetComponent <AffixEquipBehaviour>() is AffixEquipBehaviour behaviour) { //If I have one, run the modified pickup hook in the behaviour behaviour.UpdateEquipment(equipmentDef.equipmentIndex, false); } orig(self, equipmentDef); }