mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
*Do not assert !map for non-corpse worldobjects.
--HG-- branch : trunk
This commit is contained in:
@@ -81,10 +81,6 @@ bool Corpse::Create( uint32 guidlow, Player *owner)
|
||||
{
|
||||
ASSERT(owner);
|
||||
|
||||
//we need to assign owner's map for corpse
|
||||
//in other way we will get a crash in Corpse::SaveToDB()
|
||||
SetMap(owner->GetMap());
|
||||
|
||||
Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation());
|
||||
|
||||
if(!IsPositionValid())
|
||||
@@ -94,6 +90,10 @@ bool Corpse::Create( uint32 guidlow, Player *owner)
|
||||
return false;
|
||||
}
|
||||
|
||||
//we need to assign owner's map for corpse
|
||||
//in other way we will get a crash in Corpse::SaveToDB()
|
||||
SetMap(owner->GetMap());
|
||||
|
||||
WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetPhaseMask());
|
||||
|
||||
SetFloatValue( OBJECT_FIELD_SCALE_X, 1 );
|
||||
|
||||
@@ -82,10 +82,14 @@ Object::Object( ) : m_PackGUID(sizeof(uint64)+1)
|
||||
|
||||
WorldObject::~WorldObject()
|
||||
{
|
||||
// this may happen because there are many !create/delete
|
||||
if(m_isWorldObject && m_currMap)
|
||||
{
|
||||
sLog.outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in map!!", GetGUID(), GetTypeId(), GetEntry());
|
||||
assert(false);
|
||||
if(GetTypeId() == TYPEID_CORPSE)
|
||||
{
|
||||
sLog.outCrash("Object::~Object Corpse guid="UI64FMTD", type=%d, entry=%u deleted but still in map!!", GetGUID(), ((Corpse*)this)->GetType(), GetEntry());
|
||||
assert(false);
|
||||
}
|
||||
ResetMap();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user