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

@@ -2283,7 +2283,7 @@ inline void Map::setNGrid(NGridType *grid, uint32 x, uint32 y)
if (x >= MAX_NUMBER_OF_GRIDS || y >= MAX_NUMBER_OF_GRIDS)
{
sLog->outError("map::setNGrid() Invalid grid coordinates found: %d, %d!", x, y);
ASSERT(false);
ABORT();
}
i_grids[x][y] = grid;
}
@@ -2328,7 +2328,7 @@ void Map::AddObjectToSwitchList(WorldObject* obj, bool on)
else if (itr->second != on)
i_objectsToSwitch.erase(itr);
else
ASSERT(false);
ABORT();
}
void Map::RemoveAllObjectsInRemoveList()
@@ -2539,7 +2539,7 @@ bool InstanceMap::CanEnter(Player* player, bool loginCheck)
if (!loginCheck && player->GetMapRef().getTarget() == this)
{
sLog->outError("InstanceMap::CanEnter - player %s(%u) already in map %d, %d, %d!", player->GetName().c_str(), player->GetGUIDLow(), GetId(), GetInstanceId(), GetSpawnMode());
ASSERT(false);
ABORT();
return false;
}
@@ -2893,7 +2893,7 @@ bool BattlegroundMap::CanEnter(Player* player, bool loginCheck)
if (!loginCheck && player->GetMapRef().getTarget() == this)
{
sLog->outError("BGMap::CanEnter - player %u is already in map!", player->GetGUIDLow());
ASSERT(false);
ABORT();
return false;
}