private void EquipNewItem(EquipableItem equipableItem) { // Set up correct equipment reference Equipment equipment = null; if (equipableItem.IsPlayerEquipment()) { equipment = playerEquipment; } else { if (followerEquipment == null) { return; } equipment = followerEquipment; } int equipIndex = equipment.TryAddItem(equipableItem); if (equipIndex >= 0) { EquipLocation equipLocation = equipableItem.GetAllowedEquipLocation(); EquipableItem takebackItem = equipment.GetItemInSlot(equipLocation, equipIndex); RemoveItems(1); if (takebackItem != null) { equipment.RemoveItem(equipLocation, equipIndex); AddItems(takebackItem, 1, takebackItem.GetModifiers()); } equipment.AddItem(equipLocation, equipableItem, equipIndex, equipableItem.GetModifiers()); } }