mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-11 20:11:18 +03:00
* Clear a slot if amount is zero.
This commit is contained in:
@@ -180,6 +180,9 @@ ItemInstance* Inventory::getItem(int slotNo)
|
||||
if (slotNo < 0 || slotNo >= int(m_items.size()))
|
||||
return nullptr;
|
||||
|
||||
if (m_items[slotNo].m_amount <= 0)
|
||||
m_items[slotNo].m_itemID = 0;
|
||||
|
||||
return &m_items[slotNo];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user