feat(Core): Added ABORT() macro to prevent the usage of ASSERT(false) as a quick hack to crash the core misusing assert (#2273)

This commit is contained in:
Viste
2019-09-26 10:51:34 +03:00
committed by Stoabrogga
parent 58f3cfe387
commit 854b426978
28 changed files with 127 additions and 74 deletions

View File

@@ -92,7 +92,7 @@ WorldObject::~WorldObject()
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);
ABORT();
}
ResetMap();
}
@@ -105,14 +105,14 @@ Object::~Object()
sLog->outCrash("Object::~Object - guid=" UI64FMTD ", typeid=%d, entry=%u deleted but still in world!!", GetGUID(), GetTypeId(), GetEntry());
if (isType(TYPEMASK_ITEM))
sLog->outCrash("Item slot %u", ((Item*)this)->GetSlot());
ASSERT(false);
ABORT();
RemoveFromWorld();
}
if (m_objectUpdated)
{
sLog->outCrash("Object::~Object - guid=" UI64FMTD ", typeid=%d, entry=%u deleted but still in update list!!", GetGUID(), GetTypeId(), GetEntry());
ASSERT(false);
ABORT();
sObjectAccessor->RemoveUpdateObject(this);
}
@@ -2059,7 +2059,7 @@ void WorldObject::SetMap(Map* map)
if (m_currMap)
{
sLog->outCrash("WorldObject::SetMap: obj %u new map %u %u, old map %u %u", (uint32)GetTypeId(), map->GetId(), map->GetInstanceId(), m_currMap->GetId(), m_currMap->GetInstanceId());
ASSERT(false);
ABORT();
}
m_currMap = map;
m_mapId = map->GetId();