예제 #1
0
        public void DamageActiveTool(int damageCount)
        {
            if (m_subsystemGameInfo.WorldSettings.GameMode == GameMode.Creative || Inventory == null)
            {
                return;
            }
            int num = BlocksManager.DamageItem(ActiveBlockValue, damageCount);

            if (num != 0)
            {
                int slotCount = Inventory.GetSlotCount(Inventory.ActiveSlotIndex);
                Inventory.RemoveSlotItems(Inventory.ActiveSlotIndex, slotCount);
                if (Inventory.GetSlotCount(Inventory.ActiveSlotIndex) == 0)
                {
                    Inventory.AddSlotItems(Inventory.ActiveSlotIndex, num, slotCount);
                }
            }
            else
            {
                Inventory.RemoveSlotItems(Inventory.ActiveSlotIndex, 1);
            }
        }