mirror of
https://github.com/azerothcore/azerothcore-wotlk.git
synced 2025-12-15 14:50:44 -08:00
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:
parent
58f3cfe387
commit
854b426978
28 changed files with 127 additions and 74 deletions
|
|
@ -228,7 +228,7 @@ namespace MMAP
|
|||
// if the grid is later reloaded, dtNavMesh::addTile will return error but no extra memory is used
|
||||
// we cannot recover from this error - assert out
|
||||
sLog->outError("MMAP:unloadMap: Could not unload %03u%02i%02i.mmtile from navmesh", mapId, x, y);
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,26 +6,45 @@
|
|||
|
||||
#include "Errors.h"
|
||||
|
||||
#include <ace/Stack_Trace.h>
|
||||
#include <ace/OS_NS_unistd.h>
|
||||
#include <thread>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace Trinity {
|
||||
|
||||
void Assert(char const* file, int line, char const* function, char const* message)
|
||||
{
|
||||
ACE_Stack_Trace st;
|
||||
fprintf(stderr, "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n",
|
||||
file, line, function, message, st.c_str());
|
||||
fprintf(stderr, "\n%s:%i in %s ASSERTION FAILED:\n %s\n",
|
||||
file, line, function, message);
|
||||
*((volatile int*)NULL) = 0;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void Fatal(char const* file, int line, char const* function, char const* message)
|
||||
void Assert(char const* file, int line, char const* function, char const* message, char const* format, ...)
|
||||
{
|
||||
fprintf(stderr, "\n%s:%i in %s FATAL ERROR:\n %s\n",
|
||||
file, line, function, message);
|
||||
ACE_OS::sleep(10);
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
fprintf(stderr, "\n%s:%i in %s ASSERTION FAILED:\n %s ", file, line, function, message);
|
||||
vfprintf(stderr, format, args);
|
||||
fprintf(stderr, "\n");
|
||||
fflush(stderr);
|
||||
|
||||
va_end(args);
|
||||
*((volatile int*)NULL) = 0;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void Fatal(char const* file, int line, char const* function, char const* message, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, message);
|
||||
|
||||
fprintf(stderr, "\n%s:%i in %s FATAL ERROR:\n ", file, line, function);
|
||||
vfprintf(stderr, message, args);
|
||||
fprintf(stderr, "\n");
|
||||
fflush(stderr);
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::seconds(10));
|
||||
*((volatile int*)NULL) = 0;
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -44,4 +63,20 @@ void Warning(char const* file, int line, char const* function, char const* messa
|
|||
file, line, function, message);
|
||||
}
|
||||
|
||||
void Abort(char const* file, int line, char const* function)
|
||||
{
|
||||
fprintf(stderr, "\n%s:%i in %s ABORTED.\n",
|
||||
file, line, function);
|
||||
*((volatile int*)NULL) = 0;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void AbortHandler(int /*sigval*/)
|
||||
{
|
||||
// nothing useful to log here, no way to pass args
|
||||
*((volatile int*)NULL) = 0;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
} // namespace Trinity
|
||||
|
|
|
|||
|
|
@ -13,26 +13,44 @@ namespace Trinity
|
|||
{
|
||||
|
||||
DECLSPEC_NORETURN void Assert(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
|
||||
DECLSPEC_NORETURN void Assert(char const* file, int line, char const* function, char const* message, char const* format, ...) ATTR_NORETURN ATTR_PRINTF(5, 6);
|
||||
|
||||
DECLSPEC_NORETURN void Fatal(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
|
||||
DECLSPEC_NORETURN void Fatal(char const* file, int line, char const* function, char const* message, ...) ATTR_NORETURN ATTR_PRINTF(4, 5);
|
||||
|
||||
DECLSPEC_NORETURN void Error(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
|
||||
|
||||
DECLSPEC_NORETURN void Abort(char const* file, int line, char const* function) ATTR_NORETURN;
|
||||
|
||||
void Warning(char const* file, int line, char const* function, char const* message);
|
||||
|
||||
DECLSPEC_NORETURN void AbortHandler(int sigval) ATTR_NORETURN;
|
||||
|
||||
} // namespace Trinity
|
||||
|
||||
#define WPAssert(cond) do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, #cond); } while (0)
|
||||
#define WPFatal(cond, msg) do { if (!(cond)) Trinity::Fatal(__FILE__, __LINE__, __FUNCTION__, (msg)); } while (0)
|
||||
#define WPError(cond, msg) do { if (!(cond)) Trinity::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while (0)
|
||||
#define WPWarning(cond, msg) do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while (0)
|
||||
#if COMPILER == COMPILER_MICROSOFT
|
||||
#define ASSERT_BEGIN __pragma(warning(push)) __pragma(warning(disable: 4127))
|
||||
#define ASSERT_END __pragma(warning(pop))
|
||||
#else
|
||||
#define ASSERT_BEGIN
|
||||
#define ASSERT_END
|
||||
#endif
|
||||
|
||||
#define WPAssert(cond, ...) ASSERT_BEGIN do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, #cond, ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
#define WPFatal(cond, ...) ASSERT_BEGIN do { if (!(cond)) Trinity::Fatal(__FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__); } while(0) ASSERT_END
|
||||
#define WPError(cond, msg) ASSERT_BEGIN do { if (!(cond)) Trinity::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
|
||||
#define WPWarning(cond, msg) ASSERT_BEGIN do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
|
||||
#define WPAbort() ASSERT_BEGIN do { Trinity::Abort(__FILE__, __LINE__, __FUNCTION__); } while(0) ASSERT_END
|
||||
|
||||
#define ASSERT WPAssert
|
||||
#define ABORT WPAbort
|
||||
|
||||
template <typename T> inline T* ASSERT_NOTNULL(T* pointer)
|
||||
template <typename T>
|
||||
inline T* ASSERT_NOTNULL_IMPL(T* pointer, char const* expr)
|
||||
{
|
||||
ASSERT(pointer);
|
||||
ASSERT(pointer, "%s", expr);
|
||||
return pointer;
|
||||
}
|
||||
|
||||
#define ASSERT_NOTNULL(pointer) ASSERT_NOTNULL_IMPL(pointer, #pointer)
|
||||
|
||||
#endif
|
||||
|
|
@ -542,7 +542,7 @@ bool CompareValues(ComparisionType type, T val1, T val2)
|
|||
return val1 <= val2;
|
||||
default:
|
||||
// incorrect parameter
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1168,7 +1168,7 @@ void Battleground::Init()
|
|||
if (m_BgInvitedPlayers[TEAM_ALLIANCE] > 0 || m_BgInvitedPlayers[TEAM_HORDE] > 0)
|
||||
{
|
||||
sLog->outError("Battleground::Reset: one of the counters is not 0 (alliance: %u, horde: %u) for BG (map: %u, instance id: %u)!", m_BgInvitedPlayers[TEAM_ALLIANCE], m_BgInvitedPlayers[TEAM_HORDE], m_MapId, m_InstanceID);
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
|
||||
m_BgInvitedPlayers[TEAM_ALLIANCE] = 0;
|
||||
|
|
|
|||
|
|
@ -1024,7 +1024,7 @@ void RandomBattlegroundSystem::Update(uint32 diff)
|
|||
case BATTLEGROUND_EY: m_SwitchTimer = 40*IN_MILLISECONDS; break; // max 15 per team
|
||||
case BATTLEGROUND_AB: m_SwitchTimer = 40*IN_MILLISECONDS; break; // max 15 per team
|
||||
case BATTLEGROUND_SA: m_SwitchTimer = 40*IN_MILLISECONDS; break; // max 15 per team
|
||||
default: ASSERT(false); break;
|
||||
default: ABORT(); break;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool sentToBg, uint32 playerQu
|
|||
QueuedPlayersMap::iterator itr = m_QueuedPlayers.find(guid);
|
||||
if (itr == m_QueuedPlayers.end())
|
||||
{
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -286,7 +286,7 @@ void BattlegroundQueue::RemovePlayer(uint64 guid, bool sentToBg, uint32 playerQu
|
|||
//player can't be in queue without group, but just in case
|
||||
if (group_itr == m_QueuedGroups[_bracketId][_groupType].end())
|
||||
{
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -842,7 +842,7 @@ BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object)
|
|||
if (object == BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE)
|
||||
return BG_AV_NODES_SNOWFALL_GRAVE;
|
||||
sLog->outError("BattlegroundAV: ERROR! GetPlace got a wrong object :(");
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
return BG_AV_Nodes(0);
|
||||
}
|
||||
|
||||
|
|
@ -882,7 +882,7 @@ uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node)
|
|||
else if (m_Nodes[node].OwnerId == TEAM_NEUTRAL)
|
||||
return BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE;
|
||||
sLog->outError("BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i", node);
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1464,22 +1464,22 @@ void BattlegroundAV::AssaultNode(BG_AV_Nodes node, TeamId teamId)
|
|||
if (m_Nodes[node].TotalOwnerId == teamId)
|
||||
{
|
||||
sLog->outCrash("Assaulting team is TotalOwner of node");
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
if (m_Nodes[node].OwnerId == teamId)
|
||||
{
|
||||
sLog->outCrash("Assaulting team is owner of node");
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
if (m_Nodes[node].State == POINT_DESTROYED)
|
||||
{
|
||||
sLog->outCrash("Destroyed node is being assaulted");
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
if (m_Nodes[node].State == POINT_ASSAULTED && m_Nodes[node].TotalOwnerId != TEAM_NEUTRAL) //only assault an assaulted node if no totalowner exists
|
||||
{
|
||||
sLog->outCrash("Assault on an not assaulted node with total owner");
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
//the timer gets another time, if the previous owner was 0 == Neutral
|
||||
m_Nodes[node].Timer = (m_Nodes[node].PrevOwnerId != TEAM_NEUTRAL)? BG_AV_CAPTIME : BG_AV_SNOWFALL_FIRSTCAP;
|
||||
|
|
|
|||
|
|
@ -825,7 +825,7 @@ bool BattlegroundSA::CanInteractWithObject(uint32 objectId)
|
|||
return false;
|
||||
break;
|
||||
default:
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -988,7 +988,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source)
|
|||
SendWarningToAll(LANG_BG_SA_H_GY_SOUTH);
|
||||
break;
|
||||
default:
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ void Puppet::InitSummon()
|
|||
else
|
||||
{
|
||||
sLog->outMisc("Puppet::InitSummon (B1)");
|
||||
//ASSERT(false); // ZOMG!
|
||||
//ABORT(); // ZOMG!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -700,7 +700,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Mov
|
|||
// Owner already found and different than expected owner - remove object from old owner
|
||||
if (owner && GetOwnerGUID() && GetOwnerGUID() != owner)
|
||||
{
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
m_spawnedByDefault = false; // all object with owner is despawned after delay
|
||||
SetUInt64Value(OBJECT_FIELD_CREATED_BY, owner);
|
||||
|
|
|
|||
|
|
@ -1036,7 +1036,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player)
|
|||
delete pItem;
|
||||
}
|
||||
else
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -180,11 +180,11 @@ class Pet : public Guardian
|
|||
private:
|
||||
void SaveToDB(uint32, uint8, uint32) // override of Creature::SaveToDB - must not be called
|
||||
{
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
void DeleteFromDB() // override of Creature::DeleteFromDB - must not be called
|
||||
{
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -3890,7 +3890,7 @@ bool Player::_addSpell(uint32 spellId, uint8 addSpecMask, bool temporary)
|
|||
{
|
||||
sLog->outString("TRYING TO LEARN SPELL WITH EFFECT LEARN: %u, PLAYER: %u", spellId, GetGUIDLow());
|
||||
return false;
|
||||
//ASSERT(false);
|
||||
//ABORT();
|
||||
}
|
||||
else if (const SpellInfo* learnSpell = sSpellMgr->GetSpellInfo(spellInfo->Effects[i].TriggerSpell))
|
||||
_addSpell(learnSpell->Id, SPEC_MASK_ALL, true);
|
||||
|
|
@ -3943,7 +3943,7 @@ bool Player::_addSpell(uint32 spellId, uint8 addSpecMask, bool temporary)
|
|||
sLog->outString("TRYING TO LEARN SPELL WITH EFFECT LEARN 2: %u, PLAYER: %u", spellId, GetGUIDLow());
|
||||
m_spells.erase(spellInfo->Id); // mem leak, but should never happen
|
||||
return false;
|
||||
//ASSERT(false);
|
||||
//ABORT();
|
||||
}
|
||||
// pussywizard: cast passive spells (including all talents without SPELL_EFFECT_LEARN_SPELL) with additional checks
|
||||
else if (spellInfo->IsPassive() || (spellInfo->HasAttribute(SPELL_ATTR0_HIDDEN_CLIENTSIDE) && spellInfo->Stances))
|
||||
|
|
@ -20905,7 +20905,7 @@ void Player::StopCastingCharm()
|
|||
if (charm->GetCharmerGUID())
|
||||
{
|
||||
sLog->outCrash("Charmed unit has charmer guid " UI64FMTD, charm->GetCharmerGUID());
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
else
|
||||
SetCharm(charm, false);
|
||||
|
|
@ -24521,7 +24521,7 @@ void Player::SetBattlegroundOrBattlefieldRaid(Group *group, int8 subgroup)
|
|||
if (GetGroup() && (GetGroup()->isBGGroup() || GetGroup()->isBFGroup()))
|
||||
{
|
||||
sLog->outMisc("Player::SetBattlegroundOrBattlefieldRaid - current group is %s group!", (GetGroup()->isBGGroup() ? "BG" : "BF"));
|
||||
//ASSERT(false); // pussywizard: origanal group can never be bf/bg group
|
||||
//ABORT(); // pussywizard: origanal group can never be bf/bg group
|
||||
}
|
||||
|
||||
SetOriginalGroup(GetGroup(), GetSubGroup());
|
||||
|
|
|
|||
|
|
@ -4052,7 +4052,7 @@ void Unit::_UnapplyAura(AuraApplication * aurApp, AuraRemoveMode removeMode)
|
|||
else
|
||||
++iter;
|
||||
}
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
|
||||
void Unit::_RemoveNoStackAurasDueToAura(Aura* aura)
|
||||
|
|
@ -4145,7 +4145,7 @@ void Unit::RemoveOwnedAura(Aura* aura, AuraRemoveMode removeMode)
|
|||
}
|
||||
}
|
||||
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
|
||||
Aura* Unit::GetOwnedAura(uint32 spellId, uint64 casterGUID, uint64 itemCasterGUID, uint8 reqEffMask, Aura* except) const
|
||||
|
|
@ -9895,7 +9895,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
|
|||
{
|
||||
OutDebugInfo();
|
||||
(*itr)->OutDebugInfo();
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
ASSERT((*itr)->GetTypeId() == TYPEID_UNIT);
|
||||
|
||||
|
|
@ -14377,7 +14377,7 @@ void Unit::RemoveFromWorld()
|
|||
if (GetCharmerGUID())
|
||||
{
|
||||
sLog->outCrash("Unit %u has charmer guid when removed from world", GetEntry());
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
|
||||
if (Unit* owner = GetOwner())
|
||||
|
|
@ -14387,7 +14387,7 @@ void Unit::RemoveFromWorld()
|
|||
if (HasUnitTypeMask(UNIT_MASK_MINION|UNIT_MASK_GUARDIAN))
|
||||
owner->SetMinion((Minion*)this, false);
|
||||
sLog->outString("Unit %u is in controlled list of %u when removed from world", GetEntry(), owner->GetEntry());
|
||||
//ASSERT(false);
|
||||
//ABORT();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -17151,7 +17151,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
|
|||
{
|
||||
// sLog->outCrash("Unit::RemoveCharmedBy: this: " UI64FMTD " true charmer: " UI64FMTD " false charmer: " UI64FMTD,
|
||||
// GetGUID(), GetCharmerGUID(), charmer->GetGUID());
|
||||
// ASSERT(false);
|
||||
// ABORT();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -18260,7 +18260,7 @@ void Unit::ChangeSeat(int8 seatId, bool next)
|
|||
|
||||
m_vehicle->RemovePassenger(this);
|
||||
if (!m_vehicle->AddPassenger(this, seatId))
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
|
||||
void Unit::ExitVehicle(Position const* /*exitPosition*/)
|
||||
|
|
|
|||
|
|
@ -1327,7 +1327,7 @@ class SafeUnitPointer
|
|||
{
|
||||
public:
|
||||
explicit SafeUnitPointer(Unit* defVal) : ptr(defVal), defaultValue(defVal) {}
|
||||
SafeUnitPointer(const SafeUnitPointer& /*p*/) { ASSERT(false); }
|
||||
SafeUnitPointer(const SafeUnitPointer& /*p*/) { ABORT(); }
|
||||
void Initialize(Unit* defVal) { defaultValue = defVal; ptr = defVal; }
|
||||
~SafeUnitPointer();
|
||||
void SetPointedTo(Unit* u);
|
||||
|
|
|
|||
|
|
@ -390,7 +390,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
|
|||
try
|
||||
{
|
||||
if (!_me->SetCharmedBy(unit, CHARM_TYPE_VEHICLE))
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1331,7 +1331,7 @@ void WorldSession::HandlePlayerLoginToCharInWorld(Player* pCurrChar)
|
|||
|
||||
void WorldSession::HandlePlayerLoginToCharOutOfWorld(Player* /*pCurrChar*/)
|
||||
{
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
|
||||
void WorldSession::HandleSetFactionAtWar(WorldPacket& recvData)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -182,13 +182,13 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save,
|
|||
if (!entry)
|
||||
{
|
||||
sLog->outError("CreateInstance: no entry for map %d", GetId());
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
const InstanceTemplate* iTemplate = sObjectMgr->GetInstanceTemplate(GetId());
|
||||
if (!iTemplate)
|
||||
{
|
||||
sLog->outError("CreateInstance: no instance template for map %d", GetId());
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
|
||||
// some instances only have one difficulty
|
||||
|
|
@ -272,6 +272,6 @@ bool MapInstanced::DestroyInstance(InstancedMaps::iterator &itr)
|
|||
|
||||
bool MapInstanced::CanEnter(Player* /*player*/, bool /*loginCheck*/)
|
||||
{
|
||||
//ASSERT(false);
|
||||
//ABORT();
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ protected:
|
|||
typedef void (SplineBase::*InitMethtod)(const Vector3*, index_type, bool, index_type);
|
||||
static InitMethtod initializers[ModesEnd];
|
||||
|
||||
void UninitializedSpline() const { ASSERT(false);}
|
||||
void UninitializedSpline() const { ABORT();}
|
||||
|
||||
public:
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class ScriptRegistry
|
|||
sLog->outError("Script '%s' already assigned with the same script name, so the script can't work.",
|
||||
script->GetName().c_str());
|
||||
|
||||
ASSERT(false); // Error that should be fixed ASAP.
|
||||
ABORT(); // Error that should be fixed ASAP.
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1120,7 +1120,7 @@ bool ScriptMgr::OnAreaTrigger(Player* player, AreaTrigger const* trigger)
|
|||
Battleground* ScriptMgr::CreateBattleground(BattlegroundTypeId /*typeId*/)
|
||||
{
|
||||
// TODO: Implement script-side battlegrounds.
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1608,7 +1608,7 @@ class ScriptRegistry
|
|||
sLog->outError("Script '%s' already assigned with the same script name, so the script can't work.",
|
||||
script->GetName().c_str());
|
||||
|
||||
ASSERT(false); // Error that should be fixed ASAP.
|
||||
ABORT(); // Error that should be fixed ASAP.
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owne
|
|||
aura = new DynObjAura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID);
|
||||
break;
|
||||
default:
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
return NULL;
|
||||
}
|
||||
// aura can be removed in Unit::_AddAura call
|
||||
|
|
@ -498,7 +498,7 @@ void Aura::_UnapplyForTarget(Unit* target, Unit* caster, AuraApplication * auraA
|
|||
{
|
||||
sLog->outError("Aura::_UnapplyForTarget, target:%u, caster:%u, spell:%u was not found in owners application map!",
|
||||
target->GetGUIDLow(), caster ? caster->GetGUIDLow() : 0, auraApp->GetBase()->GetSpellInfo()->Id);
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
|
||||
// aura has to be already applied
|
||||
|
|
@ -594,7 +594,7 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
|
|||
else
|
||||
{
|
||||
// ok, we have one unit twice in target map (impossible, but...)
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -662,7 +662,7 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
|
|||
sLog->outCrash("Aura %u: Owner %s (map %u) is not in the same map as target %s (map %u).", GetSpellInfo()->Id,
|
||||
GetOwner()->GetName().c_str(), GetOwner()->IsInWorld() ? GetOwner()->GetMap()->GetId() : uint32(-1),
|
||||
itr->first->GetName().c_str(), itr->first->IsInWorld() ? itr->first->GetMap()->GetId() : uint32(-1));
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
itr->first->_CreateAuraApplication(this, itr->second);
|
||||
++itr;
|
||||
|
|
@ -715,7 +715,7 @@ void Aura::UpdateOwner(uint32 diff, WorldObject* owner)
|
|||
{
|
||||
if (owner != m_owner)
|
||||
{
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
|
|
|
|||
|
|
@ -7595,7 +7595,7 @@ SpellEvent::~SpellEvent()
|
|||
{
|
||||
sLog->outError("~SpellEvent: %s %u tried to delete non-deletable spell %u. Was not deleted, causes memory leak.",
|
||||
(m_Spell->GetCaster()->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), m_Spell->GetCaster()->GetGUIDLow(), m_Spell->m_spellInfo->Id);
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -8093,7 +8093,7 @@ bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMo
|
|||
hookType = SPELL_SCRIPT_HOOK_EFFECT_HIT_TARGET;
|
||||
break;
|
||||
default:
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
return false;
|
||||
}
|
||||
(*scritr)->_PrepareScriptCall(hookType);
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ public:
|
|||
else if (getMSTimeDiff(_lastChange, curtime) > _delayTime)
|
||||
{
|
||||
sLog->outString("World Thread hangs, kicking out server!");
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
|
||||
ACORE::Thread::Sleep(1000);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ void MPQManager::InitializeDBC()
|
|||
if (BaseLocale == -1)
|
||||
{
|
||||
printf("No locale data detected. Please make sure that the executable is in the same folder as your WoW installation.\n");
|
||||
ASSERT(false);
|
||||
ABORT();
|
||||
}
|
||||
else
|
||||
printf("Using default locale: %s\n", Languages[BaseLocale]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue