diff options
| author | Azazel <azazel.kon@gmail.com> | 2011-04-29 16:48:15 +0600 |
|---|---|---|
| committer | Azazel <azazel.kon@gmail.com> | 2011-04-29 16:48:15 +0600 |
| commit | 6fb2bf4224b20c0ccecfceaca8d39ae27b8677ea (patch) | |
| tree | eedb96236b09d49bdbcbf5d8931dffc60f4b2f22 /src/server/game/Guilds | |
| parent | e1647aaa29cc984672a5f6e56b08278140375443 (diff) | |
Core: use enum InventoryResult as return type for functions working with player items.
Original patch by TOM_RUS.
Diffstat (limited to 'src/server/game/Guilds')
| -rwxr-xr-x | src/server/game/Guilds/Guild.cpp | 8 | ||||
| -rwxr-xr-x | src/server/game/Guilds/Guild.h | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 8b0e8350844..f26a3328474 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -757,10 +757,10 @@ bool Guild::MoveItemData::CheckItem(uint32& splitedAmount) return true; } -uint8 Guild::MoveItemData::CanStore(Item* pItem, bool swap, bool sendError) +bool Guild::MoveItemData::CanStore(Item* pItem, bool swap, bool sendError) { m_vec.clear(); - uint8 msg = _CanStore(pItem, swap); + InventoryResult msg = _CanStore(pItem, swap); if (sendError && msg != EQUIP_ERR_OK) m_pPlayer->SendEquipError(msg, pItem); return (msg == EQUIP_ERR_OK); @@ -848,7 +848,7 @@ void Guild::PlayerMoveItemData::LogBankEvent(SQLTransaction& trans, MoveItemData pFrom->GetItem()->GetEntry(), count); } -inline uint8 Guild::PlayerMoveItemData::_CanStore(Item* pItem, bool swap) +inline InventoryResult Guild::PlayerMoveItemData::_CanStore(Item* pItem, bool swap) { return m_pPlayer->CanStoreItem(m_container, m_slotId, m_vec, pItem, swap); } @@ -1020,7 +1020,7 @@ void Guild::BankMoveItemData::_CanStoreItemInTab(Item* pItem, uint8 skipSlotId, } } -uint8 Guild::BankMoveItemData::_CanStore(Item* pItem, bool swap) +InventoryResult Guild::BankMoveItemData::_CanStore(Item* pItem, bool swap) { sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: CanStore() tab = %u, slot = %u, item = %u, count = %u", m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index 6865ab09b83..97e484bb5ce 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -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; |
