|
@@ -55,7 +55,7 @@ void Player::useItemSlot( ItemSlot* zSlot )
|
|
|
{
|
|
|
if( zSlot->zStack() )
|
|
|
{
|
|
|
- ItemStack* stack = zSlot->takeItemsOut( 1, NO_DIRECTION );
|
|
|
+ ItemStack* stack = takeItemsOut( zSlot, 1, NO_DIRECTION );
|
|
|
if( stack )
|
|
|
{
|
|
|
Item* item = stack->extractFromStack();
|
|
@@ -63,6 +63,7 @@ void Player::useItemSlot( ItemSlot* zSlot )
|
|
|
if( item->getDurability() > 0 && item->getDamage() < item->getMaxDamage() )
|
|
|
{ // put used item back
|
|
|
stack->addToStack( item );
|
|
|
+ // TODO: use inventory wrapper to update the cache of the inventory
|
|
|
if( !zSlot->numberOfAddableItems( stack, NO_DIRECTION ) )
|
|
|
{ // move other items to other space
|
|
|
ItemStack* oldItems = zSlot->takeItemsOut( zSlot->zStack()->getSize(), NO_DIRECTION );
|