public void RemoveActiveTool(int removeCount) { if (Inventory != null) { Inventory.RemoveSlotItems(Inventory.ActiveSlotIndex, removeCount); } }
public bool Place(TerrainRaycastResult raycastResult) { if (Place1 != null) { return(Place1(raycastResult)); } if (Place(raycastResult, ActiveBlockValue)) { if (Inventory != null) { Inventory.RemoveSlotItems(Inventory.ActiveSlotIndex, 1); } return(true); } return(false); }
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); } }