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:
@@ -281,6 +281,15 @@ bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Returns true if Item is a bag AND it is not empty.
|
||||
// Returns false if Item is not a bag OR it is an empty bag.
|
||||
bool Item::IsNotEmptyBag() const
|
||||
{
|
||||
if (const Bag* pBag = ToBag())
|
||||
return !pBag->IsEmpty();
|
||||
return false;
|
||||
}
|
||||
|
||||
void Item::UpdateDuration(Player* owner, uint32 diff)
|
||||
{
|
||||
if (!GetUInt32Value(ITEM_FIELD_DURATION))
|
||||
|
||||
Reference in New Issue
Block a user