Core: use enum InventoryResult as return type for functions working with player items.

Original patch by TOM_RUS.
This commit is contained in:
Azazel
2011-04-29 16:48:15 +06:00
parent e1647aaa29
commit 6fb2bf4224
22 changed files with 164 additions and 191 deletions
+4 -4
View File
@@ -506,7 +506,7 @@ private:
// Defines if player has rights to withdraw item from container
virtual bool HasWithdrawRights(MoveItemData* /*pOther*/) const { return true; }
// Checks if container can store specified item
uint8 CanStore(Item* pItem, bool swap, bool sendError);
bool CanStore(Item* pItem, bool swap, bool sendError);
// Clones stored item
bool CloneItem(uint32 count);
// Remove item from container (if splited update items fields)
@@ -524,7 +524,7 @@ private:
uint8 GetContainer() const { return m_container; }
uint8 GetSlotId() const { return m_slotId; }
protected:
virtual uint8 _CanStore(Item* pItem, bool swap) = 0;
virtual InventoryResult _CanStore(Item* pItem, bool swap) = 0;
Guild* m_pGuild;
Player *m_pPlayer;
@@ -547,7 +547,7 @@ private:
Item* StoreItem(SQLTransaction& trans, Item* pItem);
void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const;
protected:
uint8 _CanStore(Item* pItem, bool swap);
InventoryResult _CanStore(Item* pItem, bool swap);
};
class BankMoveItemData : public MoveItemData
@@ -566,7 +566,7 @@ private:
void LogAction(MoveItemData* pFrom) const;
protected:
uint8 _CanStore(Item* pItem, bool swap);
InventoryResult _CanStore(Item* pItem, bool swap);
private:
Item* _StoreItem(SQLTransaction& trans, BankTab* pTab, Item *pItem, ItemPosCount& pos, bool clone) const;