All pastes #137731 Raw Edit

Anonymous

public text v1 · immutable
#137731 ·published 2006-08-18 16:42 UTC
rendered paste body
***************
*** 6500,6520 ****
      return EQUIP_ERR_ITEM_NOT_FOUND;
  }
  
- // Return stored item (if stored to stack, it can diff. from pItem)
- Item* Player::StoreNewItem( uint16 pos, uint32 item, uint32 count, bool update )
  {
      Item *pItem = CreateItem( item, count );
      if( pItem )
      {
          ItemPrototype const *pProto = pItem->GetProto();
          ItemAdded( item, count );
-         return StoreItem( pos, pItem, update );
      }
-     return NULL;
  }
  
- // Return stored item (if stored to stack, it can diff. from pItem)
- Item* Player::StoreItem( uint16 pos, Item *pItem, bool update )
  {
      if( pItem )
      {
--- 6416,6433 ----
      return EQUIP_ERR_ITEM_NOT_FOUND;
  }
  
+ void Player::StoreNewItem( uint16 pos, uint32 item, uint32 count, bool update )
  {
      Item *pItem = CreateItem( item, count );
      if( pItem )
      {
          ItemPrototype const *pProto = pItem->GetProto();
          ItemAdded( item, count );
+         StoreItem( pos, pItem, update );
      }
  }
  
+ void Player::StoreItem( uint16 pos, Item *pItem, bool update )
  {
      if( pItem )
      {
***************
*** 6565,6574 ****
              if( IsInWorld() && update )
                  pItem2->SendUpdateToPlayer( this );
              delete pItem;
-             return pItem2;
          }
      }
-     return pItem;
  }
  
  void Player::EquipItem( uint16 pos, Item *pItem, bool update )
--- 6478,6485 ----
              if( IsInWorld() && update )
                  pItem2->SendUpdateToPlayer( this );
              delete pItem;
          }
      }
  }
  
  void Player::EquipItem( uint16 pos, Item *pItem, bool update )