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

This commit is contained in:
StormBytePP committed 2015-09-21 15:11:06 +02:00
1 parent ff71da2b05
commit 7b245a0b6b
23 files changed
+62 -55

No files matched your search

+4 -4
View File
@@ -67,7 +67,7 @@ WorldObject::~WorldObject()
{
TC_LOG_FATAL("misc", "WorldObject::~WorldObject Corpse Type: %d (%s) deleted but still in map!!",
ToCorpse()->GetType(), GetGUID().ToString().c_str());
ASSERT(false);
ABORT();
}
ResetMap();
}
@@ -80,14 +80,14 @@ Object::~Object()
TC_LOG_FATAL("misc", "Object::~Object %s deleted but still in world!!", GetGUID().ToString().c_str());
if (isType(TYPEMASK_ITEM))
TC_LOG_FATAL("misc", "Item slot %u", ((Item*)this)->GetSlot());
ASSERT(false);
ABORT();
RemoveFromWorld();
}
if (m_objectUpdated)
{
TC_LOG_FATAL("misc", "Object::~Object %s deleted but still in update list!!", GetGUID().ToString().c_str());
ASSERT(false);
ABORT();
sObjectAccessor->RemoveUpdateObject(this);
}
@@ -1795,7 +1795,7 @@ void WorldObject::SetMap(Map* map)
if (m_currMap)
{
TC_LOG_FATAL("misc", "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();