*Do not allow to add/remove obj to/from world more than once.
--HG-- branch : trunk
This commit is contained in:
+11
-5
@@ -114,16 +114,22 @@ Pet::~Pet()
|
||||
void Pet::AddToWorld()
|
||||
{
|
||||
///- Register the pet for guid lookup
|
||||
if(!IsInWorld()) ObjectAccessor::Instance().AddObject(this);
|
||||
Unit::AddToWorld();
|
||||
if(!IsInWorld())
|
||||
{
|
||||
ObjectAccessor::Instance().AddObject(this);
|
||||
Unit::AddToWorld();
|
||||
}
|
||||
}
|
||||
|
||||
void Pet::RemoveFromWorld()
|
||||
{
|
||||
///- Remove the pet from the accessor
|
||||
if(IsInWorld()) ObjectAccessor::Instance().RemoveObject(this);
|
||||
///- Don't call the function for Creature, normal mobs + totems go in a different storage
|
||||
Unit::RemoveFromWorld();
|
||||
if(IsInWorld())
|
||||
{
|
||||
ObjectAccessor::Instance().RemoveObject(this);
|
||||
///- Don't call the function for Creature, normal mobs + totems go in a different storage
|
||||
Unit::RemoveFromWorld();
|
||||
}
|
||||
}
|
||||
|
||||
bool Pet::LoadPetFromDB( Unit* owner, uint32 petentry, uint32 petnumber, bool current )
|
||||
|
||||
Reference in New Issue
Block a user