示例#1
0
        public static bool Prefix(ItemDrop.ItemData item, Inventory ___m_inventory)
        {
            if (!EquipmentAndQuickSlots.EquipmentSlotsEnabled.Value)
            {
                return(true);
            }

            if (_dropping)
            {
                return(false);
            }

            _shouldDrop = false;
            if (item != null && EquipmentAndQuickSlots.IsSlotEquippable(item) && EquipmentAndQuickSlots.IsEquipmentSlot(item.m_gridPos))
            {
                if (___m_inventory.HaveEmptySlot())
                {
                    var correctInventorySlot = ___m_inventory.FindEmptySlot(false);
                    EquipUtil.MoveItemToSlot(___m_inventory, item, correctInventorySlot);
                }
                else
                {
                    _shouldDrop = true;
                }
            }

            return(true);
        }
示例#2
0
        public static bool Prefix(ItemDrop.ItemData item, Inventory ___m_inventory)
        {
            if (EquipmentAndQuickSlots.EquipmentSlotsEnabled.Value && item != null && EquipmentAndQuickSlots.IsSlotEquippable(item))
            {
                var currentInventorySlot = item.m_gridPos;
                var correctInventorySlot = EquipmentAndQuickSlots.GetEquipmentSlotForType(item.m_shared.m_itemType);
                if (currentInventorySlot != correctInventorySlot)
                {
                    EquipUtil.MoveItemToSlot(___m_inventory, item, correctInventorySlot);
                }
            }

            return(true);
        }