1
0

Added RemoveItem() function to the player inventory.

This commit is contained in:
Howaner
2014-07-18 23:11:59 +02:00
parent f1be1eb674
commit 51b91befbd
5 changed files with 93 additions and 4 deletions

View File

@@ -151,6 +151,24 @@ int cInventory::AddItems(cItems & a_ItemStackList, bool a_AllowNewStacks, bool a
int cInventory::RemoveItem(const cItem & a_ItemStack)
{
int RemovedItems = m_HotbarSlots.RemoveItem(a_ItemStack);
if (RemovedItems < a_ItemStack.m_ItemCount)
{
cItem Temp(a_ItemStack);
Temp.m_ItemCount -= RemovedItems;
RemovedItems += m_InventorySlots.RemoveItem(Temp);
}
return RemovedItems;
}
bool cInventory::RemoveOneEquippedItem(void)
{
if (m_HotbarSlots.GetSlot(m_EquippedSlotNum).IsEmpty())