Core/Cleanup: remove C-style cast to (Bag*):

* add ToBag() methods for Item class;
* add GetBagByPos() method for Player class.
This commit is contained in:
Azazel
2011-03-18 15:58:08 +06:00
parent 90a3fee232
commit e49b5b44d6
9 changed files with 156 additions and 183 deletions
+1
View File
@@ -1175,6 +1175,7 @@ class Player : public Unit, public GridObject<Player>
Item* GetItemByEntry(uint32 entry) const;
Item* GetItemByPos(uint16 pos) const;
Item* GetItemByPos(uint8 bag, uint8 slot) const;
Bag* GetBagByPos(uint8 slot) const;
inline Item* GetUseableItemByPos(uint8 bag, uint8 slot) const //Does additional check for disarmed weapons
{
if (!CanUseAttackType(GetAttackBySlot(slot)))