*use ASSERT macro instead of regular assert for better output.

--HG--
branch : trunk
This commit is contained in:
QAston
2010-07-30 20:04:28 +02:00
parent 3dc29732b7
commit 48b360097c
50 changed files with 261 additions and 261 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ TotemAI::Permissible(const Creature *creature)
TotemAI::TotemAI(Creature *c) : CreatureAI(c), i_victimGuid(0) TotemAI::TotemAI(Creature *c) : CreatureAI(c), i_victimGuid(0)
{ {
assert(c->isTotem()); ASSERT(c->isTotem());
} }
void void
+3 -3
View File
@@ -84,7 +84,7 @@ namespace FactorySelector
{ {
const CreatureAICreator *factory = iter->second; const CreatureAICreator *factory = iter->second;
const SelectableAI *p = dynamic_cast<const SelectableAI *>(factory); const SelectableAI *p = dynamic_cast<const SelectableAI *>(factory);
assert(p != NULL); ASSERT(p != NULL);
int val = p->Permit(creature); int val = p->Permit(creature);
if (val > best_val) if (val > best_val)
{ {
@@ -104,7 +104,7 @@ namespace FactorySelector
MovementGenerator* selectMovementGenerator(Creature *creature) MovementGenerator* selectMovementGenerator(Creature *creature)
{ {
MovementGeneratorRegistry& mv_registry(*MovementGeneratorRepository::instance()); MovementGeneratorRegistry& mv_registry(*MovementGeneratorRepository::instance());
assert(creature->GetCreatureInfo() != NULL); ASSERT(creature->GetCreatureInfo() != NULL);
const MovementGeneratorCreator *mv_factory = mv_registry.GetRegistryItem(creature->GetDefaultMovementType()); const MovementGeneratorCreator *mv_factory = mv_registry.GetRegistryItem(creature->GetDefaultMovementType());
/* if (mv_factory == NULL) /* if (mv_factory == NULL)
@@ -116,7 +116,7 @@ namespace FactorySelector
{ {
const MovementGeneratorCreator *factory = mv_registry.GetRegistryItem((*iter).c_str()); const MovementGeneratorCreator *factory = mv_registry.GetRegistryItem((*iter).c_str());
const SelectableMovement *p = dynamic_cast<const SelectableMovement *>(factory); const SelectableMovement *p = dynamic_cast<const SelectableMovement *>(factory);
assert(p != NULL); ASSERT(p != NULL);
int val = p->Permit(creature); int val = p->Permit(creature);
if (val > best_val) if (val > best_val)
{ {
@@ -240,7 +240,7 @@ void BattleGroundAV::HandleQuestComplete(uint32 questid, Player *player)
void BattleGroundAV::UpdateScore(uint16 team, int16 points) void BattleGroundAV::UpdateScore(uint16 team, int16 points)
{ //note: to remove reinforcementpoints points must be negative, for adding reinforcements points must be positive { //note: to remove reinforcementpoints points must be negative, for adding reinforcements points must be positive
assert(team == ALLIANCE || team == HORDE); ASSERT(team == ALLIANCE || team == HORDE);
uint8 teamindex = GetTeamIndexByTeamId(team); //0=ally 1=horde uint8 teamindex = GetTeamIndexByTeamId(team); //0=ally 1=horde
m_Team_Scores[teamindex] += points; m_Team_Scores[teamindex] += points;
@@ -266,7 +266,7 @@ Creature* BattleGroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
uint8 level; uint8 level;
bool isStatic = false; bool isStatic = false;
Creature* creature = NULL; Creature* creature = NULL;
assert(type <= AV_CPLACE_MAX + AV_STATICCPLACE_MAX); ASSERT(type <= AV_CPLACE_MAX + AV_STATICCPLACE_MAX);
if (type >= AV_CPLACE_MAX) //static if (type >= AV_CPLACE_MAX) //static
{ {
type -= AV_CPLACE_MAX; type -= AV_CPLACE_MAX;
@@ -630,7 +630,7 @@ void BattleGroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
{ //mine=0 northmine mine=1 southmin { //mine=0 northmine mine=1 southmin
//changing the owner results in setting respawntim to infinite for current creatures, spawning new mine owners creatures and changing the chest-objects so that the current owning team can use them //changing the owner results in setting respawntim to infinite for current creatures, spawning new mine owners creatures and changing the chest-objects so that the current owning team can use them
assert(mine == AV_NORTH_MINE || mine == AV_SOUTH_MINE); ASSERT(mine == AV_NORTH_MINE || mine == AV_SOUTH_MINE);
if (team != ALLIANCE && team != HORDE) if (team != ALLIANCE && team != HORDE)
team = AV_NEUTRAL_TEAM; team = AV_NEUTRAL_TEAM;
else else
@@ -729,7 +729,7 @@ bool BattleGroundAV::PlayerCanDoMineQuest(int32 GOId,uint32 team)
void BattleGroundAV::PopulateNode(BG_AV_Nodes node) void BattleGroundAV::PopulateNode(BG_AV_Nodes node)
{ {
uint32 owner = m_Nodes[node].Owner; uint32 owner = m_Nodes[node].Owner;
assert(owner); ASSERT(owner);
uint32 c_place = AV_CPLACE_DEFENSE_STORM_AID + (4 * node); uint32 c_place = AV_CPLACE_DEFENSE_STORM_AID + (4 * node);
uint32 creatureid; uint32 creatureid;
@@ -809,7 +809,7 @@ const BG_AV_Nodes BattleGroundAV::GetNodeThroughObject(uint32 object)
if (object == BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE) if (object == BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE)
return BG_AV_NODES_SNOWFALL_GRAVE; return BG_AV_NODES_SNOWFALL_GRAVE;
sLog.outError("BattleGroundAV: ERROR! GetPlace got a wrong object :("); sLog.outError("BattleGroundAV: ERROR! GetPlace got a wrong object :(");
assert(false); ASSERT(false);
return BG_AV_Nodes(0); return BG_AV_Nodes(0);
} }
@@ -845,7 +845,7 @@ const uint32 BattleGroundAV::GetObjectThroughNode(BG_AV_Nodes node)
else if (m_Nodes[node].Owner == AV_NEUTRAL_TEAM) else if (m_Nodes[node].Owner == AV_NEUTRAL_TEAM)
return BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE; return BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE;
sLog.outError("BattleGroundAV: Error! GetPlaceNode couldn't resolve node %i",node); sLog.outError("BattleGroundAV: Error! GetPlaceNode couldn't resolve node %i",node);
assert(false); ASSERT(false);
return 0; return 0;
} }
@@ -881,7 +881,7 @@ void BattleGroundAV::EventPlayerClickedOnFlag(Player *source, GameObject* target
void BattleGroundAV::EventPlayerDefendsPoint(Player* player, uint32 object) void BattleGroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
{ {
assert(GetStatus() == STATUS_IN_PROGRESS); ASSERT(GetStatus() == STATUS_IN_PROGRESS);
BG_AV_Nodes node = GetNodeThroughObject(object); BG_AV_Nodes node = GetNodeThroughObject(object);
uint32 owner = m_Nodes[node].Owner; //maybe should name it prevowner uint32 owner = m_Nodes[node].Owner; //maybe should name it prevowner
@@ -891,7 +891,7 @@ void BattleGroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
return; return;
if (m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM) if (m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM)
{ //until snowfall doesn't belong to anyone it is better handled in assault-code { //until snowfall doesn't belong to anyone it is better handled in assault-code
assert(node == BG_AV_NODES_SNOWFALL_GRAVE); //currently the only neutral grave ASSERT(node == BG_AV_NODES_SNOWFALL_GRAVE); //currently the only neutral grave
EventPlayerAssaultsPoint(player,object); EventPlayerAssaultsPoint(player,object);
return; return;
} }
@@ -952,7 +952,7 @@ void BattleGroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
void BattleGroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) void BattleGroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
{ {
assert(GetStatus() == STATUS_IN_PROGRESS); ASSERT(GetStatus() == STATUS_IN_PROGRESS);
BG_AV_Nodes node = GetNodeThroughObject(object); BG_AV_Nodes node = GetNodeThroughObject(object);
uint32 owner = m_Nodes[node].Owner; //maybe name it prevowner uint32 owner = m_Nodes[node].Owner; //maybe name it prevowner
@@ -965,7 +965,7 @@ void BattleGroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
{ {
if (object == BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE) //initial capping if (object == BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE) //initial capping
{ {
assert(owner == AV_NEUTRAL_TEAM && m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM); ASSERT(owner == AV_NEUTRAL_TEAM && m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM);
if (team == ALLIANCE) if (team == ALLIANCE)
SpawnBGObject(BG_AV_OBJECT_FLAG_C_A_SNOWFALL_GRAVE, RESPAWN_IMMEDIATELY); SpawnBGObject(BG_AV_OBJECT_FLAG_C_A_SNOWFALL_GRAVE, RESPAWN_IMMEDIATELY);
else else
@@ -974,7 +974,7 @@ void BattleGroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
} }
else if (m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM) //recapping, when no team owns this node realy else if (m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM) //recapping, when no team owns this node realy
{ {
assert(m_Nodes[node].State != POINT_CONTROLED); ASSERT(m_Nodes[node].State != POINT_CONTROLED);
if (team == ALLIANCE) if (team == ALLIANCE)
SpawnBGObject(object-11, RESPAWN_IMMEDIATELY); SpawnBGObject(object-11, RESPAWN_IMMEDIATELY);
else else
@@ -1002,7 +1002,7 @@ void BattleGroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
//if snowfall gots capped it can be handled like all other graveyards //if snowfall gots capped it can be handled like all other graveyards
if (m_Nodes[node].TotalOwner != AV_NEUTRAL_TEAM) if (m_Nodes[node].TotalOwner != AV_NEUTRAL_TEAM)
{ {
assert(m_Nodes[node].Owner != AV_NEUTRAL_TEAM); ASSERT(m_Nodes[node].Owner != AV_NEUTRAL_TEAM);
if (team == ALLIANCE) if (team == ALLIANCE)
SpawnBGObject(object-22, RESPAWN_IMMEDIATELY); SpawnBGObject(object-22, RESPAWN_IMMEDIATELY);
else else
@@ -1098,7 +1098,7 @@ void BattleGroundAV::FillInitialWorldStates(WorldPacket& data)
const uint8 BattleGroundAV::GetWorldStateType(uint8 state, uint16 team) //this is used for node worldstates and returns values which fit good into the worldstatesarray const uint8 BattleGroundAV::GetWorldStateType(uint8 state, uint16 team) //this is used for node worldstates and returns values which fit good into the worldstatesarray
{ {
//neutral stuff cant get handled (currently its only snowfall) //neutral stuff cant get handled (currently its only snowfall)
assert(team != AV_NEUTRAL_TEAM); ASSERT(team != AV_NEUTRAL_TEAM);
//a_c a_a h_c h_a the positions in worldstate-array //a_c a_a h_c h_a the positions in worldstate-array
if (team == ALLIANCE) if (team == ALLIANCE)
{ {
@@ -1129,10 +1129,10 @@ void BattleGroundAV::UpdateNodeWorldState(BG_AV_Nodes node)
void BattleGroundAV::SendMineWorldStates(uint32 mine) void BattleGroundAV::SendMineWorldStates(uint32 mine)
{ {
assert(mine == AV_NORTH_MINE || mine == AV_SOUTH_MINE); ASSERT(mine == AV_NORTH_MINE || mine == AV_SOUTH_MINE);
// currently i'm sure, that this works (: // currently i'm sure, that this works (:
// assert(m_Mine_PrevOwner[mine] == ALLIANCE || m_Mine_PrevOwner[mine] == HORDE || m_Mine_PrevOwner[mine] == AV_NEUTRAL_TEAM); // ASSERT(m_Mine_PrevOwner[mine] == ALLIANCE || m_Mine_PrevOwner[mine] == HORDE || m_Mine_PrevOwner[mine] == AV_NEUTRAL_TEAM);
// assert(m_Mine_Owner[mine] == ALLIANCE || m_Mine_Owner[mine] == HORDE || m_Mine_Owner[mine] == AV_NEUTRAL_TEAM); // ASSERT(m_Mine_Owner[mine] == ALLIANCE || m_Mine_Owner[mine] == HORDE || m_Mine_Owner[mine] == AV_NEUTRAL_TEAM);
uint8 owner,prevowner,mine2; //those variables are needed to access the right worldstate in the BG_AV_MineWorldStates array uint8 owner,prevowner,mine2; //those variables are needed to access the right worldstate in the BG_AV_MineWorldStates array
mine2 = (mine == AV_NORTH_MINE)?0:1; mine2 = (mine == AV_NORTH_MINE)?0:1;
@@ -1396,22 +1396,22 @@ void BattleGroundAV::AssaultNode(BG_AV_Nodes node, uint16 team)
if (m_Nodes[node].TotalOwner == team) if (m_Nodes[node].TotalOwner == team)
{ {
sLog.outCrash("Assaulting team is TotalOwner of node"); sLog.outCrash("Assaulting team is TotalOwner of node");
assert (false); ASSERT (false);
} }
if (m_Nodes[node].Owner == team) if (m_Nodes[node].Owner == team)
{ {
sLog.outCrash("Assaulting team is owner of node"); sLog.outCrash("Assaulting team is owner of node");
assert (false); ASSERT (false);
} }
if (m_Nodes[node].State == POINT_DESTROYED) if (m_Nodes[node].State == POINT_DESTROYED)
{ {
sLog.outCrash("Destroyed node is being assaulted"); sLog.outCrash("Destroyed node is being assaulted");
assert (false); ASSERT (false);
} }
if (m_Nodes[node].State == POINT_ASSAULTED && m_Nodes[node].TotalOwner) //only assault an assaulted node if no totalowner exists if (m_Nodes[node].State == POINT_ASSAULTED && m_Nodes[node].TotalOwner) //only assault an assaulted node if no totalowner exists
{ {
sLog.outCrash("Assault on an not assaulted node with total owner"); sLog.outCrash("Assault on an not assaulted node with total owner");
assert (false); ASSERT (false);
} }
//the timer gets another time, if the previous owner was 0 == Neutral //the timer gets another time, if the previous owner was 0 == Neutral
m_Nodes[node].Timer = (m_Nodes[node].PrevOwner)? BG_AV_CAPTIME : BG_AV_SNOWFALL_FIRSTCAP; m_Nodes[node].Timer = (m_Nodes[node].PrevOwner)? BG_AV_CAPTIME : BG_AV_SNOWFALL_FIRSTCAP;
@@ -1423,7 +1423,7 @@ void BattleGroundAV::AssaultNode(BG_AV_Nodes node, uint16 team)
void BattleGroundAV::DestroyNode(BG_AV_Nodes node) void BattleGroundAV::DestroyNode(BG_AV_Nodes node)
{ {
assert(m_Nodes[node].State == POINT_ASSAULTED); ASSERT(m_Nodes[node].State == POINT_ASSAULTED);
m_Nodes[node].TotalOwner = m_Nodes[node].Owner; m_Nodes[node].TotalOwner = m_Nodes[node].Owner;
m_Nodes[node].PrevOwner = m_Nodes[node].Owner; m_Nodes[node].PrevOwner = m_Nodes[node].Owner;
@@ -1446,9 +1446,9 @@ void BattleGroundAV::InitNode(BG_AV_Nodes node, uint16 team, bool tower)
void BattleGroundAV::DefendNode(BG_AV_Nodes node, uint16 team) void BattleGroundAV::DefendNode(BG_AV_Nodes node, uint16 team)
{ {
assert(m_Nodes[node].TotalOwner == team); ASSERT(m_Nodes[node].TotalOwner == team);
assert(m_Nodes[node].Owner != team); ASSERT(m_Nodes[node].Owner != team);
assert(m_Nodes[node].State != POINT_CONTROLED && m_Nodes[node].State != POINT_DESTROYED); ASSERT(m_Nodes[node].State != POINT_CONTROLED && m_Nodes[node].State != POINT_DESTROYED);
m_Nodes[node].PrevOwner = m_Nodes[node].Owner; m_Nodes[node].PrevOwner = m_Nodes[node].Owner;
m_Nodes[node].Owner = team; m_Nodes[node].Owner = team;
m_Nodes[node].PrevState = m_Nodes[node].State; m_Nodes[node].PrevState = m_Nodes[node].State;
+2 -2
View File
@@ -280,7 +280,7 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* pAttacker, Hostile
currentRef = (*iter); currentRef = (*iter);
Unit* target = currentRef->getTarget(); Unit* target = currentRef->getTarget();
assert(target); // if the ref has status online the target must be there ! ASSERT(target); // if the ref has status online the target must be there !
// some units are prefered in comparison to others // some units are prefered in comparison to others
if (!noPriorityTargetFound && (target->IsImmunedToDamage(pAttacker->GetMeleeDamageSchoolMask()) || target->HasNegativeAuraWithInterruptFlag(AURA_INTERRUPT_FLAG_TAKE_DAMAGE))) if (!noPriorityTargetFound && (target->IsImmunedToDamage(pAttacker->GetMeleeDamageSchoolMask()) || target->HasNegativeAuraWithInterruptFlag(AURA_INTERRUPT_FLAG_TAKE_DAMAGE)))
@@ -375,7 +375,7 @@ void ThreatManager::addThreat(Unit* pVictim, float fThreat, SpellSchoolMask scho
if (!pVictim->isAlive() || !getOwner()->isAlive()) if (!pVictim->isAlive() || !getOwner()->isAlive())
return; return;
assert(getOwner()->GetTypeId() == TYPEID_UNIT); ASSERT(getOwner()->GetTypeId() == TYPEID_UNIT);
float threat = ThreatCalcHelper::calcThreat(pVictim, iOwner, fThreat, schoolMask, pThreatSpell); float threat = ThreatCalcHelper::calcThreat(pVictim, iOwner, fThreat, schoolMask, pThreatSpell);
+1 -1
View File
@@ -185,7 +185,7 @@ void DisableMgr::CheckQuestDisables()
bool DisableMgr::IsDisabledFor(DisableType type, uint32 entry, Unit const* pUnit) bool DisableMgr::IsDisabledFor(DisableType type, uint32 entry, Unit const* pUnit)
{ {
assert(type < MAX_DISABLE_TYPES); ASSERT(type < MAX_DISABLE_TYPES);
if (m_DisableMap[type].empty()) if (m_DisableMap[type].empty())
return false; return false;
+3 -3
View File
@@ -193,7 +193,7 @@ static bool LoadDBC_assert_print(uint32 fsize,uint32 rsize, const std::string& f
{ {
sLog.outError("ERROR: Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).",filename.c_str(),fsize,rsize); sLog.outError("ERROR: Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).",filename.c_str(),fsize,rsize);
// assert must fail after function call // ASSERT must fail after function call
return false; return false;
} }
@@ -201,7 +201,7 @@ template<class T>
inline void LoadDBC(uint32& availableDbcLocales,barGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, const std::string& dbc_path, const std::string& filename, const std::string * custom_entries = NULL, const std::string * idname = NULL) inline void LoadDBC(uint32& availableDbcLocales,barGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, const std::string& dbc_path, const std::string& filename, const std::string * custom_entries = NULL, const std::string * idname = NULL)
{ {
// compatibility format and C++ structure sizes // compatibility format and C++ structure sizes
assert(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename)); ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename));
std::string dbc_filename = dbc_path + filename; std::string dbc_filename = dbc_path + filename;
SqlDbc * sql = NULL; SqlDbc * sql = NULL;
@@ -361,7 +361,7 @@ void LoadDBCStores(const std::string& dataPath)
for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i) for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS) if (entry->bracketId > MAX_BATTLEGROUND_BRACKETS)
assert(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data"); ASSERT(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestXPStore, dbcPath,"QuestXP.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestXPStore, dbcPath,"QuestXP.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestFactionRewardStore, dbcPath,"QuestFactionReward.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestFactionRewardStore, dbcPath,"QuestFactionReward.dbc");
+8 -8
View File
@@ -358,7 +358,7 @@ void LFGMgr::Join(Player *plr)
void LFGMgr::Leave(Player *plr, Group *grp /* = NULL*/) void LFGMgr::Leave(Player *plr, Group *grp /* = NULL*/)
{ {
uint64 guid = grp ? grp->GetGUID() : plr ? plr->GetGUID() : 0; uint64 guid = grp ? grp->GetGUID() : plr ? plr->GetGUID() : 0;
assert(guid); ASSERT(guid);
// Check if player was in a rolecheck // Check if player was in a rolecheck
if (grp) if (grp)
@@ -405,7 +405,7 @@ void LFGMgr::Leave(Player *plr, Group *grp /* = NULL*/)
/// <param name="plr">Player</param> /// <param name="plr">Player</param>
void LFGMgr::UpdateRoleCheck(Group *grp, Player *plr /* = NULL*/) void LFGMgr::UpdateRoleCheck(Group *grp, Player *plr /* = NULL*/)
{ {
assert(grp); ASSERT(grp);
uint32 rolecheckId = GUID_LOPART(grp->GetGUID()); uint32 rolecheckId = GUID_LOPART(grp->GetGUID());
LfgRoleCheck *pRoleCheck = NULL; LfgRoleCheck *pRoleCheck = NULL;
@@ -685,7 +685,7 @@ bool LFGMgr::CheckGroupRoles(LfgRolesMap &groles, bool removeLeaderFlag /*= true
/// <param name="status">Player status in LFG system</param> /// <param name="status">Player status in LFG system</param>
void LFGMgr::BuildLfgRoleCheck(WorldPacket &data, LfgRoleCheck *pRoleCheck) void LFGMgr::BuildLfgRoleCheck(WorldPacket &data, LfgRoleCheck *pRoleCheck)
{ {
assert(pRoleCheck); ASSERT(pRoleCheck);
Player *plr; Player *plr;
uint8 roles; uint8 roles;
@@ -818,7 +818,7 @@ void LFGMgr::BuildRewardBlock(WorldPacket &data, uint32 dungeon, Player *plr)
/// <param name="lock">lock status map</param> /// <param name="lock">lock status map</param>
void LFGMgr::BuildPartyLockDungeonBlock(WorldPacket &data, LfgLockStatusMap *lockMap) void LFGMgr::BuildPartyLockDungeonBlock(WorldPacket &data, LfgLockStatusMap *lockMap)
{ {
assert(lockMap); ASSERT(lockMap);
data << uint8(lockMap->size()); data << uint8(lockMap->size());
@@ -845,7 +845,7 @@ void LFGMgr::BuildPartyLockDungeonBlock(WorldPacket &data, LfgLockStatusMap *loc
/// <param name="lock">lock status list</param> /// <param name="lock">lock status list</param>
void LFGMgr::BuildPlayerLockDungeonBlock(WorldPacket &data, LfgLockStatusSet *lockSet) void LFGMgr::BuildPlayerLockDungeonBlock(WorldPacket &data, LfgLockStatusSet *lockSet)
{ {
assert(lockSet); ASSERT(lockSet);
data << uint32(lockSet->size()); // Size of lock dungeons data << uint32(lockSet->size()); // Size of lock dungeons
for (LfgLockStatusSet::iterator it = lockSet->begin(); it != lockSet->end(); ++it) for (LfgLockStatusSet::iterator it = lockSet->begin(); it != lockSet->end(); ++it)
{ {
@@ -873,8 +873,8 @@ void LFGMgr::BuildPlayerLockDungeonBlock(WorldPacket &data, LfgLockStatusSet *lo
/// <returns>LfgLockStatusMap*</returns> /// <returns>LfgLockStatusMap*</returns>
LfgLockStatusMap* LFGMgr::GetPartyLockStatusDungeons(Player *plr, LfgDungeonSet *dungeons) LfgLockStatusMap* LFGMgr::GetPartyLockStatusDungeons(Player *plr, LfgDungeonSet *dungeons)
{ {
assert(plr); ASSERT(plr);
assert(dungeons); ASSERT(dungeons);
Group *grp = plr->GetGroup(); Group *grp = plr->GetGroup();
if (!grp) if (!grp)
return NULL; return NULL;
@@ -919,7 +919,7 @@ LfgLockStatusSet* LFGMgr::GetPlayerLockStatusDungeons(Player *plr, LfgDungeonSet
for (LfgDungeonSet::const_iterator it = dungeons->begin(); it != dungeons->end(); ++it) for (LfgDungeonSet::const_iterator it = dungeons->begin(); it != dungeons->end(); ++it)
{ {
dungeon = sLFGDungeonStore.LookupEntry(*it); dungeon = sLFGDungeonStore.LookupEntry(*it);
assert(dungeon); // Will never happen - We provide a list from sLFGDungeonStore ASSERT(dungeon); // Will never happen - We provide a list from sLFGDungeonStore
locktype = LFG_LOCKSTATUS_OK; locktype = LFG_LOCKSTATUS_OK;
if (dungeon->expansion > expansion) if (dungeon->expansion > expansion)
+1 -1
View File
@@ -137,7 +137,7 @@ void Corpse::SaveToDB()
void Corpse::DeleteBonesFromWorld() void Corpse::DeleteBonesFromWorld()
{ {
assert(GetType() == CORPSE_BONES); ASSERT(GetType() == CORPSE_BONES);
Corpse* corpse = ObjectAccessor::GetCorpse(*this, GetGUID()); Corpse* corpse = ObjectAccessor::GetCorpse(*this, GetGUID());
if (!corpse) if (!corpse)
@@ -1959,7 +1959,7 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /
// friendlies and other mobs they shouldn't attack // friendlies and other mobs they shouldn't attack
bool Creature::_IsTargetAcceptable(const Unit *target) const bool Creature::_IsTargetAcceptable(const Unit *target) const
{ {
assert(target); ASSERT(target);
// if the target cannot be attacked, the target is not acceptable // if the target cannot be attacked, the target is not acceptable
if (IsFriendlyTo(target) if (IsFriendlyTo(target)
@@ -168,7 +168,7 @@ void TempSummon::Update(uint32 diff)
void TempSummon::InitStats(uint32 duration) void TempSummon::InitStats(uint32 duration)
{ {
assert(!isPet()); ASSERT(!isPet());
m_timer = duration; m_timer = duration;
m_lifetime = duration; m_lifetime = duration;
@@ -228,11 +228,11 @@ void TempSummon::SetTempSummonType(TempSummonType type)
void TempSummon::UnSummon() void TempSummon::UnSummon()
{ {
//assert(!isPet()); //ASSERT(!isPet());
if (isPet()) if (isPet())
{ {
((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT); ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);
assert(!IsInWorld()); ASSERT(!IsInWorld());
return; return;
} }
@@ -267,7 +267,7 @@ void TempSummon::SaveToDB()
Minion::Minion(SummonPropertiesEntry const *properties, Unit *owner) : TempSummon(properties, owner) Minion::Minion(SummonPropertiesEntry const *properties, Unit *owner) : TempSummon(properties, owner)
, m_owner(owner) , m_owner(owner)
{ {
assert(m_owner); ASSERT(m_owner);
m_unitTypeMask |= UNIT_MASK_MINION; m_unitTypeMask |= UNIT_MASK_MINION;
m_followAngle = PET_FOLLOW_ANGLE; m_followAngle = PET_FOLLOW_ANGLE;
} }
@@ -333,7 +333,7 @@ void Guardian::InitSummon()
Puppet::Puppet(SummonPropertiesEntry const *properties, Unit *owner) : Minion(properties, owner) Puppet::Puppet(SummonPropertiesEntry const *properties, Unit *owner) : Minion(properties, owner)
{ {
assert(owner->GetTypeId() == TYPEID_PLAYER); ASSERT(owner->GetTypeId() == TYPEID_PLAYER);
m_owner = (Player*)owner; m_owner = (Player*)owner;
m_unitTypeMask |= UNIT_MASK_PUPPET; m_unitTypeMask |= UNIT_MASK_PUPPET;
} }
@@ -349,7 +349,7 @@ void Puppet::InitSummon()
{ {
Minion::InitSummon(); Minion::InitSummon();
if (!SetCharmedBy(m_owner, CHARM_TYPE_POSSESS)) if (!SetCharmedBy(m_owner, CHARM_TYPE_POSSESS))
assert(false); ASSERT(false);
} }
void Puppet::Update(uint32 time) void Puppet::Update(uint32 time)
@@ -40,7 +40,7 @@ class DynamicObject : public WorldObject, public GridObject<DynamicObject>
void Delete(); void Delete();
void SetDuration(int32 newDuration); void SetDuration(int32 newDuration);
int32 GetDuration() const; int32 GetDuration() const;
void SetAura(Aura * aura) {assert (!m_aura && aura); m_aura = aura;} void SetAura(Aura * aura) {ASSERT (!m_aura && aura); m_aura = aura;}
void Delay(int32 delaytime); void Delay(int32 delaytime);
uint32 GetSpellId() const { return GetUInt32Value(DYNAMICOBJECT_SPELLID); } uint32 GetSpellId() const { return GetUInt32Value(DYNAMICOBJECT_SPELLID); }
uint64 GetCasterGUID() const { return GetUInt64Value(DYNAMICOBJECT_CASTER); } uint64 GetCasterGUID() const { return GetUInt64Value(DYNAMICOBJECT_CASTER); }
@@ -551,7 +551,7 @@ void GameObject::Delete()
if (Unit * owner = GetOwner()) if (Unit * owner = GetOwner())
owner->RemoveGameObject(this, false); owner->RemoveGameObject(this, false);
assert (!GetOwnerGUID()); ASSERT (!GetOwnerGUID());
SendObjectDeSpawnAnim(GetGUID()); SendObjectDeSpawnAnim(GetGUID());
SetGoState(GO_STATE_READY); SetGoState(GO_STATE_READY);
@@ -634,7 +634,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
// Owner already found and different than expected owner - remove object from old owner // Owner already found and different than expected owner - remove object from old owner
if (owner && GetOwnerGUID() && GetOwnerGUID() != owner) if (owner && GetOwnerGUID() && GetOwnerGUID() != owner)
{ {
assert(false); ASSERT(false);
} }
m_spawnedByDefault = false; // all object with owner is despawned after delay m_spawnedByDefault = false; // all object with owner is despawned after delay
SetUInt64Value(OBJECT_FIELD_CREATED_BY, owner); SetUInt64Value(OBJECT_FIELD_CREATED_BY, owner);
@@ -147,7 +147,7 @@ uint32 Bag::GetFreeSlots() const
void Bag::RemoveItem(uint8 slot, bool /*update*/) void Bag::RemoveItem(uint8 slot, bool /*update*/)
{ {
assert(slot < MAX_BAG_SIZE); ASSERT(slot < MAX_BAG_SIZE);
if (m_bagslot[slot]) if (m_bagslot[slot])
m_bagslot[slot]->SetContainer(NULL); m_bagslot[slot]->SetContainer(NULL);
@@ -158,7 +158,7 @@ void Bag::RemoveItem(uint8 slot, bool /*update*/)
void Bag::StoreItem(uint8 slot, Item *pItem, bool /*update*/) void Bag::StoreItem(uint8 slot, Item *pItem, bool /*update*/)
{ {
assert(slot < MAX_BAG_SIZE); ASSERT(slot < MAX_BAG_SIZE);
if (pItem && pItem->GetGUID() != this->GetGUID()) if (pItem && pItem->GetGUID() != this->GetGUID())
{ {
+3 -3
View File
@@ -165,7 +165,7 @@ void RemoveItemsSetItem(Player*player,ItemPrototype const *proto)
if (!eff->item_count) //all items of a set were removed if (!eff->item_count) //all items of a set were removed
{ {
assert(eff == player->ItemSetEff[setindex]); ASSERT(eff == player->ItemSetEff[setindex]);
delete eff; delete eff;
player->ItemSetEff[setindex] = NULL; player->ItemSetEff[setindex] = NULL;
} }
@@ -1031,7 +1031,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player)
if (count > pProto->GetMaxStackSize()) if (count > pProto->GetMaxStackSize())
count = pProto->GetMaxStackSize(); count = pProto->GetMaxStackSize();
assert(count !=0 && "pProto->Stackable == 0 but checked at loading already"); ASSERT(count !=0 && "pProto->Stackable == 0 but checked at loading already");
Item *pItem = NewItemOrBag(pProto); Item *pItem = NewItemOrBag(pProto);
if (pItem->Create(objmgr.GenerateLowGuid(HIGHGUID_ITEM), item, player)) if (pItem->Create(objmgr.GenerateLowGuid(HIGHGUID_ITEM), item, player))
@@ -1043,7 +1043,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player)
delete pItem; delete pItem;
} }
else else
assert(false); ASSERT(false);
return NULL; return NULL;
} }
+7 -7
View File
@@ -89,7 +89,7 @@ WorldObject::~WorldObject()
if (GetTypeId() == TYPEID_CORPSE) 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()); sLog.outCrash("Object::~Object Corpse guid="UI64FMTD", type=%d, entry=%u deleted but still in map!!", GetGUID(), ((Corpse*)this)->GetType(), GetEntry());
assert(false); ASSERT(false);
} }
ResetMap(); ResetMap();
} }
@@ -102,14 +102,14 @@ Object::~Object()
sLog.outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in world!!", GetGUID(), GetTypeId(), GetEntry()); sLog.outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in world!!", GetGUID(), GetTypeId(), GetEntry());
if (isType(TYPEMASK_ITEM)) if (isType(TYPEMASK_ITEM))
sLog.outCrash("Item slot %u", ((Item*)this)->GetSlot()); sLog.outCrash("Item slot %u", ((Item*)this)->GetSlot());
assert(false); ASSERT(false);
RemoveFromWorld(); RemoveFromWorld();
} }
if (m_objectUpdated) if (m_objectUpdated)
{ {
sLog.outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in update list!!", GetGUID(), GetTypeId(), GetEntry()); sLog.outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in update list!!", GetGUID(), GetTypeId(), GetEntry());
assert(false); ASSERT(false);
sObjectAccessor.RemoveUpdateObject(this); sObjectAccessor.RemoveUpdateObject(this);
} }
@@ -743,7 +743,7 @@ void Object::BuildFieldsUpdate(Player *pl, UpdateDataMapType &data_map) const
if (iter == data_map.end()) if (iter == data_map.end())
{ {
std::pair<UpdateDataMapType::iterator, bool> p = data_map.insert(UpdateDataMapType::value_type(pl, UpdateData())); std::pair<UpdateDataMapType::iterator, bool> p = data_map.insert(UpdateDataMapType::value_type(pl, UpdateData()));
assert(p.second); ASSERT(p.second);
iter = p.first; iter = p.first;
} }
@@ -1131,7 +1131,7 @@ bool Object::PrintIndexError(uint32 index, bool set) const
{ {
sLog.outError("Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u",(set ? "set value to" : "get value from"),index,m_valuesCount,GetTypeId(),m_objectType); sLog.outError("Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u",(set ? "set value to" : "get value from"),index,m_valuesCount,GetTypeId(),m_objectType);
// assert must fail after function call // ASSERT must fail after function call
return false; return false;
} }
@@ -1683,7 +1683,7 @@ void WorldObject::SetMap(Map * map)
if (m_currMap) 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()); 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); ASSERT(false);
} }
m_currMap = map; m_currMap = map;
m_mapId = map->GetId(); m_mapId = map->GetId();
@@ -1712,7 +1712,7 @@ Map const* WorldObject::GetBaseMap() const
void WorldObject::AddObjectToRemoveList() void WorldObject::AddObjectToRemoveList()
{ {
assert(m_uint32Values); ASSERT(m_uint32Values);
Map* map = FindMap(); Map* map = FindMap();
if (!map) if (!map)
+1 -1
View File
@@ -129,7 +129,7 @@ class Object
if (m_inWorld) if (m_inWorld)
return; return;
assert(m_uint32Values); ASSERT(m_uint32Values);
m_inWorld = true; m_inWorld = true;
+3 -3
View File
@@ -745,7 +745,7 @@ void Pet::GivePetLevel(uint8 level)
bool Pet::CreateBaseAtCreature(Creature* creature) bool Pet::CreateBaseAtCreature(Creature* creature)
{ {
assert(creature); ASSERT(creature);
if (!CreateBaseAtTamed(creature->GetCreatureInfo(), creature->GetMap(), creature->GetPhaseMask())) if (!CreateBaseAtTamed(creature->GetCreatureInfo(), creature->GetMap(), creature->GetPhaseMask()))
return false; return false;
@@ -819,7 +819,7 @@ bool Pet::CreateBaseAtTamed(CreatureInfo const * cinfo, Map * map, uint32 phaseM
bool Guardian::InitStatsForLevel(uint8 petlevel) bool Guardian::InitStatsForLevel(uint8 petlevel)
{ {
CreatureInfo const *cinfo = GetCreatureInfo(); CreatureInfo const *cinfo = GetCreatureInfo();
assert(cinfo); ASSERT(cinfo);
SetLevel(petlevel); SetLevel(petlevel);
@@ -1877,7 +1877,7 @@ bool Pet::IsPermanentPetFor(Player* owner)
bool Pet::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 pet_number) bool Pet::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 pet_number)
{ {
assert(map); ASSERT(map);
SetMap(map); SetMap(map);
SetPhaseMask(phaseMask,false); SetPhaseMask(phaseMask,false);
+2 -2
View File
@@ -246,11 +246,11 @@ class Pet : public Guardian
private: private:
void SaveToDB(uint32, uint8) // overwrited of Creature::SaveToDB - don't must be called void SaveToDB(uint32, uint8) // overwrited of Creature::SaveToDB - don't must be called
{ {
assert(false); ASSERT(false);
} }
void DeleteFromDB() // overwrited of Creature::DeleteFromDB - don't must be called void DeleteFromDB() // overwrited of Creature::DeleteFromDB - don't must be called
{ {
assert(false); ASSERT(false);
} }
}; };
#endif #endif
+16 -16
View File
@@ -1257,7 +1257,7 @@ void Player::Update(uint32 p_time)
// If this is set during update SetSpellModTakingSpell call is missing somewhere in the code // If this is set during update SetSpellModTakingSpell call is missing somewhere in the code
// Having this would prevent more aura charges to be dropped, so let's crash // Having this would prevent more aura charges to be dropped, so let's crash
//assert (!m_spellModTakingSpell); //ASSERT (!m_spellModTakingSpell);
if ( m_spellModTakingSpell) if ( m_spellModTakingSpell)
{ {
//sLog.outCrash("Player has m_pad %u during update!", m_pad); //sLog.outCrash("Player has m_pad %u during update!", m_pad);
@@ -1797,7 +1797,7 @@ void Player::TeleportOutOfMap(Map *oldMap)
{ {
sLog.outCrash("Cannot teleport player out of map!"); sLog.outCrash("Cannot teleport player out of map!");
ResetMap(); ResetMap();
assert(false); ASSERT(false);
} }
} }
@@ -4842,7 +4842,7 @@ void Player::CreateCorpse()
// we don't SaveToDB for players in battlegrounds so don't do it for corpses either // we don't SaveToDB for players in battlegrounds so don't do it for corpses either
const MapEntry *entry = sMapStore.LookupEntry(corpse->GetMapId()); const MapEntry *entry = sMapStore.LookupEntry(corpse->GetMapId());
assert(entry); ASSERT(entry);
if (entry->map_type != MAP_BATTLEGROUND) if (entry->map_type != MAP_BATTLEGROUND)
corpse->SaveToDB(); corpse->SaveToDB();
@@ -9177,7 +9177,7 @@ void Player::ResetPetTalents()
void Player::SetVirtualItemSlot(uint8 i, Item* item) void Player::SetVirtualItemSlot(uint8 i, Item* item)
{ {
assert(i < 3); ASSERT(i < 3);
if (i < 2 && item) if (i < 2 && item)
{ {
if (!item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT)) if (!item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
@@ -12873,7 +12873,7 @@ void Player::UpdateEnchantTime(uint32 time)
{ {
for (EnchantDurationList::iterator itr = m_enchantDuration.begin(),next; itr != m_enchantDuration.end(); itr=next) for (EnchantDurationList::iterator itr = m_enchantDuration.begin(),next; itr != m_enchantDuration.end(); itr=next)
{ {
assert(itr->item); ASSERT(itr->item);
next = itr; next = itr;
if (!itr->item->GetEnchantmentId(itr->slot)) if (!itr->item->GetEnchantmentId(itr->slot))
{ {
@@ -14251,7 +14251,7 @@ bool Player::CanRewardQuest(Quest const *pQuest, uint32 reward, bool msg)
void Player::AddQuest(Quest const *pQuest, Object *questGiver) void Player::AddQuest(Quest const *pQuest, Object *questGiver)
{ {
uint16 log_slot = FindQuestSlot(0); uint16 log_slot = FindQuestSlot(0);
assert(log_slot < MAX_QUEST_LOG_SIZE); ASSERT(log_slot < MAX_QUEST_LOG_SIZE);
uint32 quest_id = pQuest->GetQuestId(); uint32 quest_id = pQuest->GetQuestId();
@@ -14677,7 +14677,7 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg)
ObjectMgr::ExclusiveQuestGroups::iterator iter2 = objmgr.mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup()); ObjectMgr::ExclusiveQuestGroups::iterator iter2 = objmgr.mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup());
ObjectMgr::ExclusiveQuestGroups::iterator end = objmgr.mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup()); ObjectMgr::ExclusiveQuestGroups::iterator end = objmgr.mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup());
assert(iter2 != end); // always must be found if qPrevInfo->ExclusiveGroup != 0 ASSERT(iter2 != end); // always must be found if qPrevInfo->ExclusiveGroup != 0
for (; iter2 != end; ++iter2) for (; iter2 != end; ++iter2)
{ {
@@ -14712,7 +14712,7 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg)
ObjectMgr::ExclusiveQuestGroups::iterator iter2 = objmgr.mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup()); ObjectMgr::ExclusiveQuestGroups::iterator iter2 = objmgr.mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup());
ObjectMgr::ExclusiveQuestGroups::iterator end = objmgr.mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup()); ObjectMgr::ExclusiveQuestGroups::iterator end = objmgr.mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup());
assert(iter2 != end); // always must be found if qPrevInfo->ExclusiveGroup != 0 ASSERT(iter2 != end); // always must be found if qPrevInfo->ExclusiveGroup != 0
for (; iter2 != end; ++iter2) for (; iter2 != end; ++iter2)
{ {
@@ -14814,7 +14814,7 @@ bool Player::SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg)
ObjectMgr::ExclusiveQuestGroups::iterator iter = objmgr.mExclusiveQuestGroups.lower_bound(qInfo->GetExclusiveGroup()); ObjectMgr::ExclusiveQuestGroups::iterator iter = objmgr.mExclusiveQuestGroups.lower_bound(qInfo->GetExclusiveGroup());
ObjectMgr::ExclusiveQuestGroups::iterator end = objmgr.mExclusiveQuestGroups.upper_bound(qInfo->GetExclusiveGroup()); ObjectMgr::ExclusiveQuestGroups::iterator end = objmgr.mExclusiveQuestGroups.upper_bound(qInfo->GetExclusiveGroup());
assert(iter != end); // always must be found if qInfo->ExclusiveGroup != 0 ASSERT(iter != end); // always must be found if qInfo->ExclusiveGroup != 0
for (; iter != end; ++iter) for (; iter != end; ++iter)
{ {
@@ -15687,7 +15687,7 @@ void Player::SendQuestUpdateAddItem(Quest const* /*pQuest*/, uint32 /*item_idx*/
void Player::SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, uint64 guid, uint32 creatureOrGO_idx, uint32 old_count, uint32 add_count) void Player::SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, uint64 guid, uint32 creatureOrGO_idx, uint32 old_count, uint32 add_count)
{ {
assert(old_count + add_count < 65536 && "mob/GO count store in 16 bits 2^16 = 65536 (0..65536)"); ASSERT(old_count + add_count < 65536 && "mob/GO count store in 16 bits 2^16 = 65536 (0..65536)");
int32 entry = pQuest->ReqCreatureOrGOId[ creatureOrGO_idx ]; int32 entry = pQuest->ReqCreatureOrGOId[ creatureOrGO_idx ];
if (entry < 0) if (entry < 0)
@@ -16160,7 +16160,7 @@ bool Player::LoadFromDB(uint32 guid, SqlQueryHolder *holder)
TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(node_id); TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(node_id);
if (nodeEntry && nodeEntry->map_id == GetMapId()) if (nodeEntry && nodeEntry->map_id == GetMapId())
{ {
assert(nodeEntry); // checked in m_taxi.LoadTaxiDestinationsFromString ASSERT(nodeEntry); // checked in m_taxi.LoadTaxiDestinationsFromString
mapId = nodeEntry->map_id; mapId = nodeEntry->map_id;
Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z,0.0f); Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z,0.0f);
} }
@@ -17440,7 +17440,7 @@ void Player::ConvertInstancesToGroup(Player *player, Group *group, uint64 player
if (!group) if (!group)
group = player->GetGroup(); group = player->GetGroup();
} }
assert(player_guid); ASSERT(player_guid);
// copy all binds to the group, when changing leader it's assumed the character // copy all binds to the group, when changing leader it's assumed the character
// will not have any solo binds // will not have any solo binds
@@ -18614,7 +18614,7 @@ void Player::StopCastingCharm()
if (charm->GetCharmerGUID()) if (charm->GetCharmerGUID())
{ {
sLog.outCrash("Charmed unit has charmer guid " UI64FMTD, charm->GetCharmerGUID()); sLog.outCrash("Charmed unit has charmer guid " UI64FMTD, charm->GetCharmerGUID());
assert(false); ASSERT(false);
} }
else else
SetCharm(charm, false); SetCharm(charm, false);
@@ -19009,7 +19009,7 @@ void Player::RestoreSpellMods(Spell * spell)
// Skip this check for now - aura charges may change due to various reason // Skip this check for now - aura charges may change due to various reason
// TODO: trac these changes correctly // TODO: trac these changes correctly
//assert (mod->ownerAura->GetCharges() <= mod->charges); //ASSERT (mod->ownerAura->GetCharges() <= mod->charges);
} }
} }
} }
@@ -20876,7 +20876,7 @@ void Player::SetGroup(Group *group, int8 subgroup)
else else
{ {
// never use SetGroup without a subgroup unless you specify NULL for group // never use SetGroup without a subgroup unless you specify NULL for group
assert(subgroup >= 0); ASSERT(subgroup >= 0);
m_group.link(group, this); m_group.link(group, this);
m_group.setSubGroup((uint8)subgroup); m_group.setSubGroup((uint8)subgroup);
} }
@@ -22146,7 +22146,7 @@ void Player::SetOriginalGroup(Group *group, int8 subgroup)
else else
{ {
// never use SetOriginalGroup without a subgroup unless you specify NULL for group // never use SetOriginalGroup without a subgroup unless you specify NULL for group
assert(subgroup >= 0); ASSERT(subgroup >= 0);
m_originalGroup.link(group, this); m_originalGroup.link(group, this);
m_originalGroup.setSubGroup((uint8)subgroup); m_originalGroup.setSubGroup((uint8)subgroup);
} }
+3 -3
View File
@@ -329,7 +329,7 @@ struct EnchantDuration
{ {
EnchantDuration() : item(NULL), slot(MAX_ENCHANTMENT_SLOT), leftduration(0) {}; EnchantDuration() : item(NULL), slot(MAX_ENCHANTMENT_SLOT), leftduration(0) {};
EnchantDuration(Item * _item, EnchantmentSlot _slot, uint32 _leftduration) : item(_item), slot(_slot), EnchantDuration(Item * _item, EnchantmentSlot _slot, uint32 _leftduration) : item(_item), slot(_slot),
leftduration(_leftduration){ assert(item); }; leftduration(_leftduration){ ASSERT(item); };
Item * item; Item * item;
EnchantmentSlot slot; EnchantmentSlot slot;
@@ -1518,7 +1518,7 @@ class Player : public Unit, public GridObject<Player>
void AddMItem(Item* it) void AddMItem(Item* it)
{ {
ASSERT(it); ASSERT(it);
//assert deleted, because items can be added before loading //ASSERT deleted, because items can be added before loading
mMitems[it->GetGUIDLow()] = it; mMitems[it->GetGUIDLow()] = it;
} }
@@ -2674,7 +2674,7 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
// Charges can be set only for mods with auras // Charges can be set only for mods with auras
if (!mod->ownerAura) if (!mod->ownerAura)
assert(mod->charges == 0); ASSERT(mod->charges == 0);
if (!IsAffectedBySpellmod(spellInfo,mod,spell)) if (!IsAffectedBySpellmod(spellInfo,mod,spell))
continue; continue;
@@ -457,7 +457,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
ResetMap(); ResetMap();
Map * newMap = sMapMgr.CreateMap(newMapid, this, 0); Map * newMap = sMapMgr.CreateMap(newMapid, this, 0);
SetMap(newMap); SetMap(newMap);
assert (GetMap()); ASSERT (GetMap());
if (oldMap != newMap) if (oldMap != newMap)
{ {
+48 -48
View File
@@ -206,13 +206,13 @@ Unit::~Unit()
delete m_charmInfo; delete m_charmInfo;
delete m_vehicleKit; delete m_vehicleKit;
assert(!m_attacking); ASSERT(!m_attacking);
assert(m_attackers.empty()); ASSERT(m_attackers.empty());
assert(m_sharedVision.empty()); ASSERT(m_sharedVision.empty());
assert(m_Controlled.empty()); ASSERT(m_Controlled.empty());
assert(m_appliedAuras.empty()); ASSERT(m_appliedAuras.empty());
assert(m_ownedAuras.empty()); ASSERT(m_ownedAuras.empty());
assert(m_removedAuras.empty()); ASSERT(m_removedAuras.empty());
} }
void Unit::Update(uint32 p_time) void Unit::Update(uint32 p_time)
@@ -236,7 +236,7 @@ void Unit::Update(uint32 p_time)
// If this is set during update SetCantProc(false) call is missing somewhere in the code // If this is set during update SetCantProc(false) call is missing somewhere in the code
// Having this would prevent spells from being proced, so let's crash // Having this would prevent spells from being proced, so let's crash
assert(!m_procDeep); ASSERT(!m_procDeep);
if (CanHaveThreatList() && getThreatManager().isNeedUpdateToClient(p_time)) if (CanHaveThreatList() && getThreatManager().isNeedUpdateToClient(p_time))
SendThreatListUpdate(); SendThreatListUpdate();
@@ -812,10 +812,10 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
// last damage from duel opponent // last damage from duel opponent
if (duel_hasEnded) if (duel_hasEnded)
{ {
assert(pVictim->GetTypeId() == TYPEID_PLAYER); ASSERT(pVictim->GetTypeId() == TYPEID_PLAYER);
Player *he = (Player*)pVictim; Player *he = (Player*)pVictim;
assert(he->duel); ASSERT(he->duel);
he->SetHealth(1); he->SetHealth(1);
@@ -3362,7 +3362,7 @@ void Unit::_UpdateAutoRepeatSpell()
void Unit::SetCurrentCastedSpell(Spell * pSpell) void Unit::SetCurrentCastedSpell(Spell * pSpell)
{ {
assert(pSpell); // NULL may be never passed here, use InterruptSpell or InterruptNonMeleeSpells ASSERT(pSpell); // NULL may be never passed here, use InterruptSpell or InterruptNonMeleeSpells
CurrentSpellTypes CSpellType = pSpell->GetCurrentContainer(); CurrentSpellTypes CSpellType = pSpell->GetCurrentContainer();
@@ -3435,7 +3435,7 @@ void Unit::SetCurrentCastedSpell(Spell * pSpell)
void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool withInstant) void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool withInstant)
{ {
assert(spellType < CURRENT_MAX_SPELL); ASSERT(spellType < CURRENT_MAX_SPELL);
//sLog.outDebug("Interrupt spell for unit %u.", GetEntry()); //sLog.outDebug("Interrupt spell for unit %u.", GetEntry());
Spell *spell = m_currentSpells[spellType]; Spell *spell = m_currentSpells[spellType];
@@ -3577,7 +3577,7 @@ void Unit::DeMorph()
void Unit::_AddAura(UnitAura * aura, Unit * caster) void Unit::_AddAura(UnitAura * aura, Unit * caster)
{ {
assert(!m_cleanupDone); ASSERT(!m_cleanupDone);
m_ownedAuras.insert(AuraMap::value_type(aura->GetId(), aura)); m_ownedAuras.insert(AuraMap::value_type(aura->GetId(), aura));
// passive and Incanter's Absorption and auras with different type can stack with themselves any number of times // passive and Incanter's Absorption and auras with different type can stack with themselves any number of times
@@ -3642,9 +3642,9 @@ void Unit::_AddAura(UnitAura * aura, Unit * caster)
AuraApplication * Unit::_CreateAuraApplication(Aura * aura, uint8 effMask) AuraApplication * Unit::_CreateAuraApplication(Aura * aura, uint8 effMask)
{ {
// can't apply aura on unit which is going to be deleted - to not create a memory leak // can't apply aura on unit which is going to be deleted - to not create a memory leak
assert(!m_cleanupDone); ASSERT(!m_cleanupDone);
// aura musn't be removed // aura musn't be removed
assert(!aura->IsRemoved()); ASSERT(!aura->IsRemoved());
SpellEntry const* aurSpellInfo = aura->GetSpellProto(); SpellEntry const* aurSpellInfo = aura->GetSpellProto();
uint32 aurId = aurSpellInfo->Id; uint32 aurId = aurSpellInfo->Id;
@@ -3674,10 +3674,10 @@ AuraApplication * Unit::_CreateAuraApplication(Aura * aura, uint8 effMask)
void Unit::_ApplyAuraEffect(Aura * aura, uint8 effIndex) void Unit::_ApplyAuraEffect(Aura * aura, uint8 effIndex)
{ {
assert(aura); ASSERT(aura);
assert(aura->HasEffect(effIndex)); ASSERT(aura->HasEffect(effIndex));
AuraApplication * aurApp = aura->GetApplicationOfTarget(GetGUID()); AuraApplication * aurApp = aura->GetApplicationOfTarget(GetGUID());
assert(aurApp); ASSERT(aurApp);
if (!aurApp->GetEffectMask()) if (!aurApp->GetEffectMask())
_ApplyAura(aurApp, 1<<effIndex); _ApplyAura(aurApp, 1<<effIndex);
else else
@@ -3725,15 +3725,15 @@ void Unit::_ApplyAura(AuraApplication * aurApp, uint8 effMask)
void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode) void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode)
{ {
AuraApplication * aurApp = i->second; AuraApplication * aurApp = i->second;
assert(aurApp); ASSERT(aurApp);
assert(!aurApp->GetRemoveMode()); ASSERT(!aurApp->GetRemoveMode());
assert(aurApp->GetTarget() == this); ASSERT(aurApp->GetTarget() == this);
aurApp->SetRemoveMode(removeMode); aurApp->SetRemoveMode(removeMode);
Aura * aura = aurApp->GetBase(); Aura * aura = aurApp->GetBase();
sLog.outDebug("Aura %u now is remove mode %d", aura->GetId(), removeMode); sLog.outDebug("Aura %u now is remove mode %d", aura->GetId(), removeMode);
// dead loop is killing the server probably // dead loop is killing the server probably
assert(m_removedAurasCount < 0xFFFFFFFF); ASSERT(m_removedAurasCount < 0xFFFFFFFF);
++m_removedAurasCount; ++m_removedAurasCount;
@@ -3779,7 +3779,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo
} }
// all effect mustn't be applied // all effect mustn't be applied
assert(!aurApp->GetEffectMask()); ASSERT(!aurApp->GetEffectMask());
// Remove totem at next update if totem looses its aura // Remove totem at next update if totem looses its aura
if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && GetTypeId() == TYPEID_UNIT && this->ToCreature()->isTotem()&& this->ToTotem()->GetSummonerGUID() == aura->GetCasterGUID()) if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && GetTypeId() == TYPEID_UNIT && this->ToCreature()->isTotem()&& this->ToTotem()->GetSummonerGUID() == aura->GetCasterGUID())
@@ -3802,7 +3802,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo
void Unit::_UnapplyAura(AuraApplication * aurApp, AuraRemoveMode removeMode) void Unit::_UnapplyAura(AuraApplication * aurApp, AuraRemoveMode removeMode)
{ {
// aura can be removed from unit only if it's applied on it, shouldn't happen // aura can be removed from unit only if it's applied on it, shouldn't happen
assert(aurApp->GetBase()->GetApplicationOfTarget(GetGUID()) == aurApp); ASSERT(aurApp->GetBase()->GetApplicationOfTarget(GetGUID()) == aurApp);
uint32 spellId = aurApp->GetBase()->GetId(); uint32 spellId = aurApp->GetBase()->GetId();
for (AuraApplicationMap::iterator iter = m_appliedAuras.lower_bound(spellId); iter != m_appliedAuras.upper_bound(spellId);) for (AuraApplicationMap::iterator iter = m_appliedAuras.lower_bound(spellId); iter != m_appliedAuras.upper_bound(spellId);)
{ {
@@ -3814,7 +3814,7 @@ void Unit::_UnapplyAura(AuraApplication * aurApp, AuraRemoveMode removeMode)
else else
++iter; ++iter;
} }
assert(false); ASSERT(false);
} }
void Unit::_RemoveNoStackAuraApplicationsDueToAura(Aura * aura) void Unit::_RemoveNoStackAuraApplicationsDueToAura(Aura * aura)
@@ -3938,7 +3938,7 @@ void Unit::_HandleAuraEffect(AuraEffect * aurEff, bool apply)
void Unit::RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode) void Unit::RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode)
{ {
Aura * aura = i->second; Aura * aura = i->second;
assert(!aura->IsRemoved()); ASSERT(!aura->IsRemoved());
// if unit currently update aura list then make safe update iterator shift to next // if unit currently update aura list then make safe update iterator shift to next
if (m_auraUpdateIterator == i) if (m_auraUpdateIterator == i)
@@ -3973,7 +3973,7 @@ void Unit::RemoveOwnedAura(Aura * aura, AuraRemoveMode removeMode)
if (aura->IsRemoved()) if (aura->IsRemoved())
return; return;
assert(aura->GetOwner() == this); ASSERT(aura->GetOwner() == this);
uint32 spellId = aura->GetId(); uint32 spellId = aura->GetId();
for (AuraMap::iterator itr = m_ownedAuras.lower_bound(spellId); itr != m_ownedAuras.upper_bound(spellId); ++itr) for (AuraMap::iterator itr = m_ownedAuras.lower_bound(spellId); itr != m_ownedAuras.upper_bound(spellId); ++itr)
@@ -3982,7 +3982,7 @@ void Unit::RemoveOwnedAura(Aura * aura, AuraRemoveMode removeMode)
RemoveOwnedAura(itr, removeMode); RemoveOwnedAura(itr, removeMode);
return; return;
} }
assert(false); ASSERT(false);
} }
Aura * Unit::GetOwnedAura(uint32 spellId, uint64 caster, uint8 reqEffMask, Aura * except) const Aura * Unit::GetOwnedAura(uint32 spellId, uint64 caster, uint8 reqEffMask, Aura * except) const
@@ -4024,7 +4024,7 @@ void Unit::RemoveAura(uint32 spellId, uint64 caster, uint8 reqEffMask, AuraRemov
void Unit::RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode) void Unit::RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode)
{ {
assert(aurApp->GetBase()->GetApplicationOfTarget(GetGUID()) == aurApp); ASSERT(aurApp->GetBase()->GetApplicationOfTarget(GetGUID()) == aurApp);
// no need to remove // no need to remove
if (aurApp->GetRemoveMode() || aurApp->GetBase()->IsRemoved()) if (aurApp->GetRemoveMode() || aurApp->GetBase()->IsRemoved())
return; return;
@@ -4048,7 +4048,7 @@ void Unit::RemoveAura(Aura * aura, AuraRemoveMode mode)
if (AuraApplication * aurApp = aura->GetApplicationOfTarget(GetGUID())) if (AuraApplication * aurApp = aura->GetApplicationOfTarget(GetGUID()))
RemoveAura(aurApp, mode); RemoveAura(aurApp, mode);
else else
assert(false); ASSERT(false);
} }
void Unit::RemoveAurasDueToSpell(uint32 spellId, uint64 caster, uint8 reqEffMask, AuraRemoveMode removeMode) void Unit::RemoveAurasDueToSpell(uint32 spellId, uint64 caster, uint8 reqEffMask, AuraRemoveMode removeMode)
@@ -9602,14 +9602,14 @@ void Unit::SetMinion(Minion *minion, bool apply)
if (GetGUID() == (*itr)->GetCharmerGUID()) if (GetGUID() == (*itr)->GetCharmerGUID())
continue; continue;
//assert((*itr)->GetOwnerGUID() == GetGUID()); //ASSERT((*itr)->GetOwnerGUID() == GetGUID());
if ((*itr)->GetOwnerGUID() != GetGUID()) if ((*itr)->GetOwnerGUID() != GetGUID())
{ {
OutDebugInfo(); OutDebugInfo();
(*itr)->OutDebugInfo(); (*itr)->OutDebugInfo();
assert(false); ASSERT(false);
} }
assert((*itr)->GetTypeId() == TYPEID_UNIT); ASSERT((*itr)->GetTypeId() == TYPEID_UNIT);
if (!(*itr)->HasUnitTypeMask(UNIT_MASK_CONTROLABLE_GUARDIAN)) if (!(*itr)->HasUnitTypeMask(UNIT_MASK_CONTROLABLE_GUARDIAN))
continue; continue;
@@ -11765,7 +11765,7 @@ bool Unit::isTargetableForAttack() const
bool Unit::canAttack(Unit const* target, bool force) const bool Unit::canAttack(Unit const* target, bool force) const
{ {
assert(target); ASSERT(target);
if (force) if (force)
{ {
@@ -12364,7 +12364,7 @@ void Unit::DeleteThreatList()
void Unit::TauntApply(Unit* taunter) void Unit::TauntApply(Unit* taunter)
{ {
assert(GetTypeId() == TYPEID_UNIT); ASSERT(GetTypeId() == TYPEID_UNIT);
if (!taunter || (taunter->GetTypeId() == TYPEID_PLAYER && taunter->ToPlayer()->isGameMaster())) if (!taunter || (taunter->GetTypeId() == TYPEID_PLAYER && taunter->ToPlayer()->isGameMaster()))
return; return;
@@ -12390,7 +12390,7 @@ void Unit::TauntApply(Unit* taunter)
void Unit::TauntFadeOut(Unit *taunter) void Unit::TauntFadeOut(Unit *taunter)
{ {
assert(GetTypeId() == TYPEID_UNIT); ASSERT(GetTypeId() == TYPEID_UNIT);
if (!taunter || (taunter->GetTypeId() == TYPEID_PLAYER && taunter->ToPlayer()->isGameMaster())) if (!taunter || (taunter->GetTypeId() == TYPEID_PLAYER && taunter->ToPlayer()->isGameMaster()))
return; return;
@@ -13287,7 +13287,7 @@ void Unit::AddToWorld()
void Unit::RemoveFromWorld() void Unit::RemoveFromWorld()
{ {
// cleanup // cleanup
assert(GetGUID()); ASSERT(GetGUID());
if (IsInWorld()) if (IsInWorld())
{ {
@@ -13310,7 +13310,7 @@ void Unit::RemoveFromWorld()
if (GetCharmerGUID()) if (GetCharmerGUID())
{ {
sLog.outCrash("Unit %u has charmer guid when removed from world", GetEntry()); sLog.outCrash("Unit %u has charmer guid when removed from world", GetEntry());
assert(false); ASSERT(false);
} }
if (Unit *owner = GetOwner()) if (Unit *owner = GetOwner())
@@ -13318,7 +13318,7 @@ void Unit::RemoveFromWorld()
if (owner->m_Controlled.find(this) != owner->m_Controlled.end()) if (owner->m_Controlled.find(this) != owner->m_Controlled.end())
{ {
sLog.outCrash("Unit %u is in controlled list of %u when removed from world", GetEntry(), owner->GetEntry()); sLog.outCrash("Unit %u is in controlled list of %u when removed from world", GetEntry(), owner->GetEntry());
assert(false); ASSERT(false);
} }
} }
@@ -13331,7 +13331,7 @@ void Unit::CleanupsBeforeDelete(bool finalCleanup)
if (IsInWorld()) if (IsInWorld())
RemoveFromWorld(); RemoveFromWorld();
assert(GetGUID()); ASSERT(GetGUID());
//A unit may be in removelist and not in world, but it is still in grid //A unit may be in removelist and not in world, but it is still in grid
//and may have some references during delete //and may have some references during delete
@@ -13918,7 +13918,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag,
continue; continue;
AuraEffect *triggeredByAura = i->aura->GetEffect(effIndex); AuraEffect *triggeredByAura = i->aura->GetEffect(effIndex);
assert(triggeredByAura); ASSERT(triggeredByAura);
switch(triggeredByAura->GetAuraType()) switch(triggeredByAura->GetAuraType())
{ {
@@ -15274,8 +15274,8 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type)
if (GetTypeId() == TYPEID_PLAYER) if (GetTypeId() == TYPEID_PLAYER)
Unmount(); Unmount();
assert(type != CHARM_TYPE_POSSESS || charmer->GetTypeId() == TYPEID_PLAYER); ASSERT(type != CHARM_TYPE_POSSESS || charmer->GetTypeId() == TYPEID_PLAYER);
assert((type == CHARM_TYPE_VEHICLE) == IsVehicle()); ASSERT((type == CHARM_TYPE_VEHICLE) == IsVehicle());
sLog.outDebug("SetCharmedBy: charmer %u (GUID %u), charmed %u (GUID %u), type %u.", charmer->GetEntry(), charmer->GetGUIDLow(), GetEntry(), GetGUIDLow(), uint32(type)); sLog.outDebug("SetCharmedBy: charmer %u (GUID %u), charmed %u (GUID %u), type %u.", charmer->GetEntry(), charmer->GetGUIDLow(), GetEntry(), GetGUIDLow(), uint32(type));
@@ -15411,7 +15411,7 @@ void Unit::RemoveCharmedBy(Unit *charmer)
{ {
// sLog.outCrash("Unit::RemoveCharmedBy: this: " UI64FMTD " true charmer: " UI64FMTD " false charmer: " UI64FMTD, // sLog.outCrash("Unit::RemoveCharmedBy: this: " UI64FMTD " true charmer: " UI64FMTD " false charmer: " UI64FMTD,
// GetGUID(), GetCharmerGUID(), charmer->GetGUID()); // GetGUID(), GetCharmerGUID(), charmer->GetGUID());
// assert(false); // ASSERT(false);
return; return;
} }
@@ -15464,8 +15464,8 @@ void Unit::RemoveCharmedBy(Unit *charmer)
if (!charmer) if (!charmer)
return; return;
assert(type != CHARM_TYPE_POSSESS || charmer->GetTypeId() == TYPEID_PLAYER); ASSERT(type != CHARM_TYPE_POSSESS || charmer->GetTypeId() == TYPEID_PLAYER);
assert(type != CHARM_TYPE_VEHICLE || GetTypeId() == TYPEID_UNIT && IsVehicle()); ASSERT(type != CHARM_TYPE_VEHICLE || GetTypeId() == TYPEID_UNIT && IsVehicle());
charmer->SetCharm(this, false); charmer->SetCharm(this, false);
@@ -16273,7 +16273,7 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId)
bg->EventPlayerDroppedFlag(this->ToPlayer()); bg->EventPlayerDroppedFlag(this->ToPlayer());
} }
assert(!m_vehicle); ASSERT(!m_vehicle);
m_vehicle = vehicle; m_vehicle = vehicle;
if (!m_vehicle->AddPassenger(this, seatId)) if (!m_vehicle->AddPassenger(this, seatId))
{ {
@@ -16309,7 +16309,7 @@ void Unit::ChangeSeat(int8 seatId, bool next)
m_vehicle->RemovePassenger(this); m_vehicle->RemovePassenger(this);
if (!m_vehicle->AddPassenger(this, seatId)) if (!m_vehicle->AddPassenger(this, seatId))
assert(false); ASSERT(false);
} }
void Unit::ExitVehicle() void Unit::ExitVehicle()
+1 -1
View File
@@ -1913,7 +1913,7 @@ class Unit : public WorldObject
++m_procDeep; ++m_procDeep;
else else
{ {
assert(m_procDeep); ASSERT(m_procDeep);
--m_procDeep; --m_procDeep;
} }
} }
+9 -9
View File
@@ -61,13 +61,13 @@ Vehicle::Vehicle(Unit *unit, VehicleEntry const *vehInfo) : me(unit), m_vehicleI
default: default:
break; break;
} }
assert(!m_Seats.empty()); ASSERT(!m_Seats.empty());
} }
Vehicle::~Vehicle() Vehicle::~Vehicle()
{ {
for (SeatMap::const_iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr) for (SeatMap::const_iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr)
assert(!itr->second.passenger); ASSERT(!itr->second.passenger);
} }
void Vehicle::Install() void Vehicle::Install()
@@ -171,7 +171,7 @@ void Vehicle::RemoveAllPassengers()
if (itr->second.passenger) if (itr->second.passenger)
{ {
sLog.outCrash("Vehicle %u cannot remove passenger %u. %u is still on vehicle.", me->GetEntry(), passenger->GetEntry(), itr->second.passenger->GetEntry()); sLog.outCrash("Vehicle %u cannot remove passenger %u. %u is still on vehicle.", me->GetEntry(), passenger->GetEntry(), itr->second.passenger->GetEntry());
//assert(!itr->second.passenger); //ASSERT(!itr->second.passenger);
itr->second.passenger = NULL; itr->second.passenger = NULL;
} }
} }
@@ -222,7 +222,7 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion)
// already installed // already installed
if (passenger->GetEntry() == entry) if (passenger->GetEntry() == entry)
{ {
assert(passenger->GetTypeId() == TYPEID_UNIT); ASSERT(passenger->GetTypeId() == TYPEID_UNIT);
if (me->GetTypeId() == TYPEID_UNIT && me->ToCreature()->IsInEvadeMode() && passenger->ToCreature()->IsAIEnabled) if (me->GetTypeId() == TYPEID_UNIT && me->ToCreature()->IsInEvadeMode() && passenger->ToCreature()->IsAIEnabled)
passenger->ToCreature()->AI()->EnterEvadeMode(); passenger->ToCreature()->AI()->EnterEvadeMode();
return; return;
@@ -265,7 +265,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId)
if (seat->second.passenger) if (seat->second.passenger)
seat->second.passenger->ExitVehicle(); seat->second.passenger->ExitVehicle();
assert(!seat->second.passenger); ASSERT(!seat->second.passenger);
} }
sLog.outDebug("Unit %s enter vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first); sLog.outDebug("Unit %s enter vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first);
@@ -273,7 +273,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId)
seat->second.passenger = unit; seat->second.passenger = unit;
if (seat->second.seatInfo->IsUsable()) if (seat->second.seatInfo->IsUsable())
{ {
assert(m_usableSeatNum); ASSERT(m_usableSeatNum);
--m_usableSeatNum; --m_usableSeatNum;
if (!m_usableSeatNum) if (!m_usableSeatNum)
{ {
@@ -302,7 +302,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId)
&& unit->GetTypeId() == TYPEID_PLAYER && unit->GetTypeId() == TYPEID_PLAYER
&& seat->first == 0 && seat->second.seatInfo->m_flags & 0x800) // not right && seat->first == 0 && seat->second.seatInfo->m_flags & 0x800) // not right
if (!me->SetCharmedBy(unit, CHARM_TYPE_VEHICLE)) if (!me->SetCharmedBy(unit, CHARM_TYPE_VEHICLE))
assert(false); ASSERT(false);
if (me->IsInWorld()) if (me->IsInWorld())
{ {
@@ -335,7 +335,7 @@ void Vehicle::RemovePassenger(Unit *unit)
if (seat->second.passenger == unit) if (seat->second.passenger == unit)
break; break;
assert(seat != m_Seats.end()); ASSERT(seat != m_Seats.end());
sLog.outDebug("Unit %s exit vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first); sLog.outDebug("Unit %s exit vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first);
@@ -372,7 +372,7 @@ void Vehicle::RemovePassenger(Unit *unit)
void Vehicle::RelocatePassengers(float x, float y, float z, float ang) void Vehicle::RelocatePassengers(float x, float y, float z, float ang)
{ {
Map *map = me->GetMap(); Map *map = me->GetMap();
assert(map != NULL); ASSERT(map != NULL);
// not sure that absolute position calculation is correct, it must depend on vehicle orientation and pitch angle // not sure that absolute position calculation is correct, it must depend on vehicle orientation and pitch angle
for (SeatMap::const_iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr) for (SeatMap::const_iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr)
+5 -5
View File
@@ -197,14 +197,14 @@ Corpse* ObjectAccessor::GetCorpseForPlayerGUID(uint64 guid)
if (iter == i_player2corpse.end()) if (iter == i_player2corpse.end())
return NULL; return NULL;
assert(iter->second->GetType() != CORPSE_BONES); ASSERT(iter->second->GetType() != CORPSE_BONES);
return iter->second; return iter->second;
} }
void ObjectAccessor::RemoveCorpse(Corpse* corpse) void ObjectAccessor::RemoveCorpse(Corpse* corpse)
{ {
assert(corpse && corpse->GetType() != CORPSE_BONES); ASSERT(corpse && corpse->GetType() != CORPSE_BONES);
if (corpse->FindMap()) if (corpse->FindMap())
corpse->FindMap()->Remove(corpse, false); corpse->FindMap()->Remove(corpse, false);
@@ -231,13 +231,13 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse)
void ObjectAccessor::AddCorpse(Corpse* corpse) void ObjectAccessor::AddCorpse(Corpse* corpse)
{ {
assert(corpse && corpse->GetType() != CORPSE_BONES); ASSERT(corpse && corpse->GetType() != CORPSE_BONES);
// Critical section // Critical section
{ {
ACE_GUARD(LockType, g, i_corpseGuard); ACE_GUARD(LockType, g, i_corpseGuard);
assert(i_player2corpse.find(corpse->GetOwnerGUID()) == i_player2corpse.end()); ASSERT(i_player2corpse.find(corpse->GetOwnerGUID()) == i_player2corpse.end());
i_player2corpse[corpse->GetOwnerGUID()] = corpse; i_player2corpse[corpse->GetOwnerGUID()] = corpse;
// build mapid*cellid -> guid_set map // build mapid*cellid -> guid_set map
@@ -354,7 +354,7 @@ void ObjectAccessor::Update(uint32 /*diff*/)
while (!i_objects.empty()) while (!i_objects.empty())
{ {
Object* obj = *i_objects.begin(); Object* obj = *i_objects.begin();
assert(obj && obj->IsInWorld()); ASSERT(obj && obj->IsInWorld());
i_objects.erase(i_objects.begin()); i_objects.erase(i_objects.begin());
obj->BuildUpdate(update_players); obj->BuildUpdate(update_players);
} }
+1 -1
View File
@@ -127,7 +127,7 @@ class ObjectAccessor
// returns object if is in map // returns object if is in map
template<class T> static T* GetObjectInMap(uint64 guid, Map * map, T* /*typeSpecifier*/) template<class T> static T* GetObjectInMap(uint64 guid, Map * map, T* /*typeSpecifier*/)
{ {
assert(map); ASSERT(map);
if (T * obj = GetObjectInWorld(guid, (T*)NULL)) if (T * obj = GetObjectInWorld(guid, (T*)NULL))
if (obj->GetMap() == map) if (obj->GetMap() == map)
return obj; return obj;
+1 -1
View File
@@ -8994,7 +8994,7 @@ void ObjectMgr::RemoveGMTicket(GM_Ticket *ticket, int64 source, bool permanently
void ObjectMgr::RemoveGMTicket(uint64 ticketGuid, int64 source, bool permanently) void ObjectMgr::RemoveGMTicket(uint64 ticketGuid, int64 source, bool permanently)
{ {
GM_Ticket *ticket = GetGMTicket(ticketGuid); GM_Ticket *ticket = GetGMTicket(ticketGuid);
assert(ticket); ASSERT(ticket);
RemoveGMTicket(ticket, source, permanently); RemoveGMTicket(ticket, source, permanently);
} }
+1 -1
View File
@@ -112,7 +112,7 @@ Cell::Visit(const CellPair& standing_cell, TypeContainerVisitor<T, CONTAINER> &v
} }
default: default:
{ {
assert(false); ASSERT(false);
break; break;
} }
} }
+4 -4
View File
@@ -61,7 +61,7 @@ class Grid
template<class SPECIFIC_OBJECT> void AddWorldObject(SPECIFIC_OBJECT *obj) template<class SPECIFIC_OBJECT> void AddWorldObject(SPECIFIC_OBJECT *obj)
{ {
if(!i_objects.template insert<SPECIFIC_OBJECT>(obj)) if(!i_objects.template insert<SPECIFIC_OBJECT>(obj))
assert(false); ASSERT(false);
} }
/** an object of interested exits the grid /** an object of interested exits the grid
@@ -69,7 +69,7 @@ class Grid
template<class SPECIFIC_OBJECT> void RemoveWorldObject(SPECIFIC_OBJECT *obj) template<class SPECIFIC_OBJECT> void RemoveWorldObject(SPECIFIC_OBJECT *obj)
{ {
if(!i_objects.template remove<SPECIFIC_OBJECT>(obj)) if(!i_objects.template remove<SPECIFIC_OBJECT>(obj))
assert(false); ASSERT(false);
} }
/** Refreshes/update the grid. This required for remote grids. /** Refreshes/update the grid. This required for remote grids.
@@ -107,7 +107,7 @@ class Grid
template<class SPECIFIC_OBJECT> void AddGridObject(SPECIFIC_OBJECT *obj) template<class SPECIFIC_OBJECT> void AddGridObject(SPECIFIC_OBJECT *obj)
{ {
if(!i_container.template insert<SPECIFIC_OBJECT>(obj)) if(!i_container.template insert<SPECIFIC_OBJECT>(obj))
assert(false); ASSERT(false);
} }
/** Removes a containter type object from the grid /** Removes a containter type object from the grid
@@ -115,7 +115,7 @@ class Grid
template<class SPECIFIC_OBJECT> void RemoveGridObject(SPECIFIC_OBJECT *obj) template<class SPECIFIC_OBJECT> void RemoveGridObject(SPECIFIC_OBJECT *obj)
{ {
if(!i_container.template remove<SPECIFIC_OBJECT>(obj)) if(!i_container.template remove<SPECIFIC_OBJECT>(obj))
assert(false); ASSERT(false);
} }
/*bool NoWorldObjectInGrid() const /*bool NoWorldObjectInGrid() const
+1 -1
View File
@@ -59,7 +59,7 @@ ObjectGridRespawnMover::Visit(CreatureMapType &m)
Creature * c = iter->getSource(); Creature * c = iter->getSource();
++iter; ++iter;
assert(!c->isPet() && "ObjectGridRespawnMover don't must be called for pets"); ASSERT(!c->isPet() && "ObjectGridRespawnMover don't must be called for pets");
Cell const& cur_cell = c->GetCurrentCell(); Cell const& cur_cell = c->GetCurrentCell();
+1 -1
View File
@@ -590,7 +590,7 @@ void Group::SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r)
// notify group members which player is the allowed looter for the given creature // notify group members which player is the allowed looter for the given creature
void Group::SendLooter(Creature *pCreature, Player *pLooter) void Group::SendLooter(Creature *pCreature, Player *pLooter)
{ {
assert(pCreature); ASSERT(pCreature);
WorldPacket data(SMSG_LOOT_LIST, (8+8)); WorldPacket data(SMSG_LOOT_LIST, (8+8));
data << uint64(pCreature->GetGUID()); data << uint64(pCreature->GetGUID());
+1 -1
View File
@@ -1750,7 +1750,7 @@ uint8 Guild::_CanStoreItem_InSpecificSlot(uint8 tab, uint8 slot, GuildItemPosCou
uint8 Guild::_CanStoreItem_InTab(uint8 tab, GuildItemPosCountVec &dest, uint32& count, bool merge, Item* pSrcItem, uint8 skip_slot) const uint8 Guild::_CanStoreItem_InTab(uint8 tab, GuildItemPosCountVec &dest, uint32& count, bool merge, Item* pSrcItem, uint8 skip_slot) const
{ {
assert(pSrcItem); ASSERT(pSrcItem);
for (uint32 j = 0; j < GUILD_BANK_MAX_SLOTS; ++j) for (uint32 j = 0; j < GUILD_BANK_MAX_SLOTS; ++j)
{ {
// skip specific slot already processed in first called _CanStoreItem_InSpecificSlot // skip specific slot already processed in first called _CanStoreItem_InSpecificSlot
@@ -154,7 +154,7 @@ InstanceSave::InstanceSave(uint16 MapId, uint32 InstanceId, Difficulty difficult
InstanceSave::~InstanceSave() InstanceSave::~InstanceSave()
{ {
// the players and groups must be unbound before deleting the save // the players and groups must be unbound before deleting the save
assert(m_playerList.empty() && m_groupList.empty()); ASSERT(m_playerList.empty() && m_groupList.empty());
} }
/* /*
@@ -168,7 +168,7 @@ void InstanceSave::SaveToDB()
Map *map = sMapMgr.FindMap(GetMapId(),m_instanceid); Map *map = sMapMgr.FindMap(GetMapId(),m_instanceid);
if (map) if (map)
{ {
assert(map->IsDungeon()); ASSERT(map->IsDungeon());
if (InstanceData *iData = ((InstanceMap*)map)->GetInstanceData()) if (InstanceData *iData = ((InstanceMap*)map)->GetInstanceData())
{ {
data = iData->GetSaveData(); data = iData->GetSaveData();
@@ -222,7 +222,7 @@ bool InstanceSave::UnloadIfEmpty()
void InstanceSaveManager::_DelHelper(DatabaseType &db, const char *fields, const char *table, const char *queryTail,...) void InstanceSaveManager::_DelHelper(DatabaseType &db, const char *fields, const char *table, const char *queryTail,...)
{ {
Tokens fieldTokens = StrSplit(fields, ", "); Tokens fieldTokens = StrSplit(fields, ", ");
assert(fieldTokens.size() != 0); ASSERT(fieldTokens.size() != 0);
va_list ap; va_list ap;
char szQueryTail [MAX_QUERY_LEN]; char szQueryTail [MAX_QUERY_LEN];
+28 -28
View File
@@ -67,8 +67,8 @@ Map::~Map()
while (!i_worldObjects.empty()) while (!i_worldObjects.empty())
{ {
WorldObject *obj = *i_worldObjects.begin(); WorldObject *obj = *i_worldObjects.begin();
assert(obj->m_isWorldObject); ASSERT(obj->m_isWorldObject);
//assert(obj->GetTypeId() == TYPEID_CORPSE); //ASSERT(obj->GetTypeId() == TYPEID_CORPSE);
obj->RemoveFromWorld(); obj->RemoveFromWorld();
obj->ResetMap(); obj->ResetMap();
} }
@@ -284,7 +284,7 @@ void Map::SwitchGridContainers(T* obj, bool on)
DEBUG_LOG("Switch object " I64FMT " from grid[%u,%u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on); DEBUG_LOG("Switch object " I64FMT " from grid[%u,%u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on);
NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY()); NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY());
assert(ngrid != NULL); ASSERT(ngrid != NULL);
GridType &grid = (*ngrid)(cell.CellX(), cell.CellY()); GridType &grid = (*ngrid)(cell.CellX(), cell.CellY());
@@ -295,7 +295,7 @@ void Map::SwitchGridContainers(T* obj, bool on)
/*if (!grid.RemoveGridObject<T>(obj, obj->GetGUID()) /*if (!grid.RemoveGridObject<T>(obj, obj->GetGUID())
|| !grid.AddWorldObject<T>(obj, obj->GetGUID())) || !grid.AddWorldObject<T>(obj, obj->GetGUID()))
{ {
assert(false); ASSERT(false);
}*/ }*/
} }
else else
@@ -305,7 +305,7 @@ void Map::SwitchGridContainers(T* obj, bool on)
/*if (!grid.RemoveWorldObject<T>(obj, obj->GetGUID()) /*if (!grid.RemoveWorldObject<T>(obj, obj->GetGUID())
|| !grid.AddGridObject<T>(obj, obj->GetGUID())) || !grid.AddGridObject<T>(obj, obj->GetGUID()))
{ {
assert(false); ASSERT(false);
}*/ }*/
} }
obj->m_isWorldObject = on; obj->m_isWorldObject = on;
@@ -361,7 +361,7 @@ Map::EnsureGridLoadedAtEnter(const Cell &cell, Player *player)
{ {
EnsureGridLoaded(cell); EnsureGridLoaded(cell);
NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
assert(grid != NULL); ASSERT(grid != NULL);
if (player) if (player)
{ {
@@ -385,7 +385,7 @@ bool Map::EnsureGridLoaded(const Cell &cell)
EnsureGridCreated(GridPair(cell.GridX(), cell.GridY())); EnsureGridCreated(GridPair(cell.GridX(), cell.GridY()));
NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
assert(grid != NULL); ASSERT(grid != NULL);
if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY())) if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY()))
{ {
sLog.outDebug("Loading grid[%u,%u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId); sLog.outDebug("Loading grid[%u,%u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId);
@@ -413,7 +413,7 @@ void Map::LoadGrid(float x, float y)
bool Map::Add(Player *player) bool Map::Add(Player *player)
{ {
// Check if we are adding to correct map // Check if we are adding to correct map
assert (player->GetMap() == this); ASSERT (player->GetMap() == this);
CellPair p = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY()); CellPair p = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
if (p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP) if (p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP)
{ {
@@ -426,7 +426,7 @@ bool Map::Add(Player *player)
Cell cell(p); Cell cell(p);
EnsureGridLoadedAtEnter(cell, player); EnsureGridLoadedAtEnter(cell, player);
NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
assert(grid != NULL); ASSERT(grid != NULL);
AddToGrid(player, grid, cell); AddToGrid(player, grid, cell);
player->AddToWorld(); player->AddToWorld();
@@ -464,7 +464,7 @@ Map::Add(T *obj)
EnsureGridCreated(GridPair(cell.GridX(), cell.GridY())); EnsureGridCreated(GridPair(cell.GridX(), cell.GridY()));
NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
assert(grid != NULL); ASSERT(grid != NULL);
AddToGrid(obj,grid,cell); AddToGrid(obj,grid,cell);
//obj->SetMap(this); //obj->SetMap(this);
@@ -812,7 +812,7 @@ void Map::Remove(Player *player, bool remove)
{ {
DEBUG_LOG("Remove player %s from grid[%u,%u]", player->GetName(), cell.GridX(), cell.GridY()); DEBUG_LOG("Remove player %s from grid[%u,%u]", player->GetName(), cell.GridX(), cell.GridY());
NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
assert(grid != NULL); ASSERT(grid != NULL);
player->UpdateObjectVisibility(true); player->UpdateObjectVisibility(true);
RemoveFromGrid(player,grid,cell); RemoveFromGrid(player,grid,cell);
@@ -854,7 +854,7 @@ Map::Remove(T *obj, bool remove)
{ {
DEBUG_LOG("Remove object " I64FMT " from grid[%u,%u]", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y); DEBUG_LOG("Remove object " I64FMT " from grid[%u,%u]", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y);
NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
assert(grid != NULL); ASSERT(grid != NULL);
obj->UpdateObjectVisibility(true); obj->UpdateObjectVisibility(true);
RemoveFromGrid(obj,grid,cell); RemoveFromGrid(obj,grid,cell);
@@ -875,7 +875,7 @@ Map::Remove(T *obj, bool remove)
void void
Map::PlayerRelocation(Player *player, float x, float y, float z, float orientation) Map::PlayerRelocation(Player *player, float x, float y, float z, float orientation)
{ {
assert(player); ASSERT(player);
CellPair old_val = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY()); CellPair old_val = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
CellPair new_val = Trinity::ComputeCellPair(x, y); CellPair new_val = Trinity::ComputeCellPair(x, y);
@@ -905,7 +905,7 @@ Map::PlayerRelocation(Player *player, float x, float y, float z, float orientati
void void
Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang) Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang)
{ {
assert(CheckGridIntegrity(creature,false)); ASSERT(CheckGridIntegrity(creature,false));
Cell old_cell = creature->GetCurrentCell(); Cell old_cell = creature->GetCurrentCell();
@@ -928,7 +928,7 @@ Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang
creature->UpdateObjectVisibility(false); creature->UpdateObjectVisibility(false);
} }
assert(CheckGridIntegrity(creature,true)); ASSERT(CheckGridIntegrity(creature,true));
} }
void Map::AddCreatureToMoveList(Creature *c, float x, float y, float z, float ang) void Map::AddCreatureToMoveList(Creature *c, float x, float y, float z, float ang)
@@ -1076,7 +1076,7 @@ bool Map::CreatureRespawnRelocation(Creature *c)
bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll) bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll)
{ {
NGridType *grid = getNGrid(x, y); NGridType *grid = getNGrid(x, y);
assert(grid != NULL); ASSERT(grid != NULL);
{ {
if (!unloadAll && ActiveObjectsNearGrid(x, y)) if (!unloadAll && ActiveObjectsNearGrid(x, y))
@@ -1106,7 +1106,7 @@ bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll)
unloader.UnloadN(); unloader.UnloadN();
assert(i_objectsToRemove.empty()); ASSERT(i_objectsToRemove.empty());
delete grid; delete grid;
setNGrid(NULL, x, y); setNGrid(NULL, x, y);
@@ -2120,7 +2120,7 @@ inline void Map::setNGrid(NGridType *grid, uint32 x, uint32 y)
if (x >= MAX_NUMBER_OF_GRIDS || y >= MAX_NUMBER_OF_GRIDS) if (x >= MAX_NUMBER_OF_GRIDS || y >= MAX_NUMBER_OF_GRIDS)
{ {
sLog.outError("map::setNGrid() Invalid grid coordinates found: %d, %d!",x,y); sLog.outError("map::setNGrid() Invalid grid coordinates found: %d, %d!",x,y);
assert(false); ASSERT(false);
} }
i_grids[x][y] = grid; i_grids[x][y] = grid;
} }
@@ -2138,7 +2138,7 @@ void Map::DelayedUpdate(const uint32 t_diff)
NGridType *grid = i->getSource(); NGridType *grid = i->getSource();
GridInfo *info = i->getSource()->getGridInfoRef(); GridInfo *info = i->getSource()->getGridInfoRef();
++i; // The update might delete the map and we need the next map before the iterator gets invalid ++i; // The update might delete the map and we need the next map before the iterator gets invalid
assert(grid->GetGridState() >= 0 && grid->GetGridState() < MAX_GRID_STATE); ASSERT(grid->GetGridState() >= 0 && grid->GetGridState() < MAX_GRID_STATE);
si_GridStates[grid->GetGridState()]->Update(*this, *grid, *info, grid->getX(), grid->getY(), t_diff); si_GridStates[grid->GetGridState()]->Update(*this, *grid, *info, grid->getX(), grid->getY(), t_diff);
} }
} }
@@ -2146,7 +2146,7 @@ void Map::DelayedUpdate(const uint32 t_diff)
void Map::AddObjectToRemoveList(WorldObject *obj) void Map::AddObjectToRemoveList(WorldObject *obj)
{ {
assert(obj->GetMapId() == GetId() && obj->GetInstanceId() == GetInstanceId()); ASSERT(obj->GetMapId() == GetId() && obj->GetInstanceId() == GetInstanceId());
obj->CleanupsBeforeDelete(false); // remove or simplify at least cross referenced links obj->CleanupsBeforeDelete(false); // remove or simplify at least cross referenced links
@@ -2156,7 +2156,7 @@ void Map::AddObjectToRemoveList(WorldObject *obj)
void Map::AddObjectToSwitchList(WorldObject *obj, bool on) void Map::AddObjectToSwitchList(WorldObject *obj, bool on)
{ {
assert(obj->GetMapId() == GetId() && obj->GetInstanceId() == GetInstanceId()); ASSERT(obj->GetMapId() == GetId() && obj->GetInstanceId() == GetInstanceId());
std::map<WorldObject*, bool>::iterator itr = i_objectsToSwitch.find(obj); std::map<WorldObject*, bool>::iterator itr = i_objectsToSwitch.find(obj);
if (itr == i_objectsToSwitch.end()) if (itr == i_objectsToSwitch.end())
@@ -2164,7 +2164,7 @@ void Map::AddObjectToSwitchList(WorldObject *obj, bool on)
else if (itr->second != on) else if (itr->second != on)
i_objectsToSwitch.erase(itr); i_objectsToSwitch.erase(itr);
else else
assert(false); ASSERT(false);
} }
void Map::RemoveAllObjectsInRemoveList() void Map::RemoveAllObjectsInRemoveList()
@@ -2368,7 +2368,7 @@ bool InstanceMap::CanEnter(Player *player)
if (player->GetMapRef().getTarget() == this) if (player->GetMapRef().getTarget() == this)
{ {
sLog.outError("InstanceMap::CanEnter - player %s(%u) already in map %d,%d,%d!", player->GetName(), player->GetGUIDLow(), GetId(), GetInstanceId(), GetSpawnMode()); sLog.outError("InstanceMap::CanEnter - player %s(%u) already in map %d,%d,%d!", player->GetName(), player->GetGUIDLow(), GetId(), GetInstanceId(), GetSpawnMode());
assert(false); ASSERT(false);
return false; return false;
} }
@@ -2471,7 +2471,7 @@ bool InstanceMap::Add(Player *player)
{ {
sLog.outError("InstanceMap::Add: player %s(%d) is being put into instance %d,%d,%d,%d,%d,%d but he is in group %d and is bound to instance %d,%d,%d,%d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(pGroup->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset()); sLog.outError("InstanceMap::Add: player %s(%d) is being put into instance %d,%d,%d,%d,%d,%d but he is in group %d and is bound to instance %d,%d,%d,%d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(pGroup->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset());
if (groupBind) sLog.outError("InstanceMap::Add: the group is bound to the instance %d,%d,%d,%d,%d,%d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset()); if (groupBind) sLog.outError("InstanceMap::Add: the group is bound to the instance %d,%d,%d,%d,%d,%d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset());
//assert(false); //ASSERT(false);
return false; return false;
} }
// bind to the group or keep using the group save // bind to the group or keep using the group save
@@ -2511,7 +2511,7 @@ bool InstanceMap::Add(Player *player)
player->BindToInstance(mapSave, false); player->BindToInstance(mapSave, false);
else else
// cannot jump to a different instance without resetting it // cannot jump to a different instance without resetting it
assert(playerBind->save == mapSave); ASSERT(playerBind->save == mapSave);
} }
} }
} }
@@ -2664,7 +2664,7 @@ void InstanceMap::PermBindAllPlayers(Player *player)
void InstanceMap::UnloadAll() void InstanceMap::UnloadAll()
{ {
assert(!HavePlayers()); ASSERT(!HavePlayers());
if (m_resetAfterUnload == true) if (m_resetAfterUnload == true)
objmgr.DeleteRespawnTimeForInstance(GetInstanceId()); objmgr.DeleteRespawnTimeForInstance(GetInstanceId());
@@ -2708,7 +2708,7 @@ uint32 InstanceMap::GetMaxPlayers() const
return normalDiff ? normalDiff->maxPlayers : 0; return normalDiff ? normalDiff->maxPlayers : 0;
} }
} }
else // I'd rather assert(false); else // I'd rather ASSERT(false);
return 0; return 0;
} }
@@ -2743,7 +2743,7 @@ bool BattleGroundMap::CanEnter(Player * player)
if (player->GetMapRef().getTarget() == this) if (player->GetMapRef().getTarget() == this)
{ {
sLog.outError("BGMap::CanEnter - player %u is already in map!", player->GetGUIDLow()); sLog.outError("BGMap::CanEnter - player %u is already in map!", player->GetGUIDLow());
assert(false); ASSERT(false);
return false; return false;
} }
+3 -3
View File
@@ -190,13 +190,13 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave *save,
if (!entry) if (!entry)
{ {
sLog.outError("CreateInstance: no entry for map %d", GetId()); sLog.outError("CreateInstance: no entry for map %d", GetId());
assert(false); ASSERT(false);
} }
const InstanceTemplate * iTemplate = objmgr.GetInstanceTemplate(GetId()); const InstanceTemplate * iTemplate = objmgr.GetInstanceTemplate(GetId());
if (!iTemplate) if (!iTemplate)
{ {
sLog.outError("CreateInstance: no instance template for map %d", GetId()); sLog.outError("CreateInstance: no instance template for map %d", GetId());
assert(false); ASSERT(false);
} }
// some instances only have one difficulty // some instances only have one difficulty
@@ -261,6 +261,6 @@ bool MapInstanced::DestroyInstance(InstancedMaps::iterator &itr)
bool MapInstanced::CanEnter(Player * /*player*/) bool MapInstanced::CanEnter(Player * /*player*/)
{ {
//assert(false); //ASSERT(false);
return true; return true;
} }
+1 -1
View File
@@ -125,7 +125,7 @@ Map* MapManager::_createBaseMap(uint32 id)
i_maps[id] = m; i_maps[id] = m;
} }
assert(m != NULL); ASSERT(m != NULL);
return m; return m;
} }
+1 -1
View File
@@ -83,7 +83,7 @@ MotionMaster::UpdateMotion(uint32 diff)
{ {
if (i_owner->hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) // what about UNIT_STAT_DISTRACTED? Why is this not included? if (i_owner->hasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED)) // what about UNIT_STAT_DISTRACTED? Why is this not included?
return; return;
assert(!empty()); ASSERT(!empty());
m_cleanFlag |= MMCF_UPDATE; m_cleanFlag |= MMCF_UPDATE;
if (!top()->Update(*i_owner, diff)) if (!top()->Update(*i_owner, diff))
{ {
@@ -154,7 +154,7 @@ ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff)
if (i_nextMoveTime.Passed()) if (i_nextMoveTime.Passed())
{ {
// start moving // start moving
assert(i_nextMove <= MAX_CONF_WAYPOINTS); ASSERT(i_nextMove <= MAX_CONF_WAYPOINTS);
const float x = i_waypoints[i_nextMove][0]; const float x = i_waypoints[i_nextMove][0];
const float y = i_waypoints[i_nextMove][1]; const float y = i_waypoints[i_nextMove][1];
const float z = i_waypoints[i_nextMove][2]; const float z = i_waypoints[i_nextMove][2];
@@ -161,7 +161,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff)
{ {
if (StopedByPlayer) if (StopedByPlayer)
{ {
assert(node); ASSERT(node);
InitTraveller(unit, *node); InitTraveller(unit, *node);
i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z); i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z);
i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime());
+1 -1
View File
@@ -50,7 +50,7 @@ struct Traveller
float GetPositionZ() const { return i_traveller.GetPositionZ(); } float GetPositionZ() const { return i_traveller.GetPositionZ(); }
T& GetTraveller(void) { return i_traveller; } T& GetTraveller(void) { return i_traveller; }
float Speed(void) { assert(false); return 0.0f; } float Speed(void) { ASSERT(false); return 0.0f; }
float GetMoveDestinationTo(float x, float y, float z); float GetMoveDestinationTo(float x, float y, float z);
uint32 GetTotalTrevelTimeTo(float x, float y, float z); uint32 GetTotalTrevelTimeTo(float x, float y, float z);
@@ -67,7 +67,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
GetPlayer()->SetSemaphoreTeleportFar(false); GetPlayer()->SetSemaphoreTeleportFar(false);
Map * oldMap = GetPlayer()->GetMap(); Map * oldMap = GetPlayer()->GetMap();
assert(oldMap); ASSERT(oldMap);
if (GetPlayer()->IsInWorld()) if (GetPlayer()->IsInWorld())
{ {
sLog.outCrash("Player is still in world when teleported from map %u! to new map %u", oldMap->GetId(), loc.GetMapId()); sLog.outCrash("Player is still in world when teleported from map %u! to new map %u", oldMap->GetId(), loc.GetMapId());
@@ -244,7 +244,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data)
Unit *mover = _player->m_mover; Unit *mover = _player->m_mover;
assert(mover != NULL); // there must always be a mover ASSERT(mover != NULL); // there must always be a mover
Player *plMover = mover->GetTypeId() == TYPEID_PLAYER ? (Player*)mover : NULL; Player *plMover = mover->GetTypeId() == TYPEID_PLAYER ? (Player*)mover : NULL;
@@ -212,7 +212,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
_player->StopCastingCharm(); _player->StopCastingCharm();
else if (pet->GetOwnerGUID() == GetPlayer()->GetGUID()) else if (pet->GetOwnerGUID() == GetPlayer()->GetGUID())
{ {
assert(pet->GetTypeId() == TYPEID_UNIT); ASSERT(pet->GetTypeId() == TYPEID_UNIT);
if (pet->isPet()) if (pet->isPet())
{ {
if (((Pet*)pet)->getPetType() == HUNTER_PET) if (((Pet*)pet)->getPetType() == HUNTER_PET)
@@ -878,7 +878,7 @@ void AuraEffect::CalculateSpellMod()
{ {
m_spellmod = new SpellModifier(GetBase()); m_spellmod = new SpellModifier(GetBase());
m_spellmod->op = SpellModOp(GetMiscValue()); m_spellmod->op = SpellModOp(GetMiscValue());
assert(m_spellmod->op < MAX_SPELLMOD); ASSERT(m_spellmod->op < MAX_SPELLMOD);
m_spellmod->type = SpellModType(GetAuraType()); // SpellModType value == spell aura types m_spellmod->type = SpellModType(GetAuraType()); // SpellModType value == spell aura types
m_spellmod->spellId = GetId(); m_spellmod->spellId = GetId();
@@ -917,7 +917,7 @@ void AuraEffect::ChangeAmount(int32 newAmount, bool mark)
void AuraEffect::HandleEffect(AuraApplication const * aurApp, uint8 mode, bool apply) void AuraEffect::HandleEffect(AuraApplication const * aurApp, uint8 mode, bool apply)
{ {
// check if call is correct // check if call is correct
assert(!mode ASSERT(!mode
|| mode == AURA_EFFECT_HANDLE_REAL || mode == AURA_EFFECT_HANDLE_REAL
|| mode == AURA_EFFECT_HANDLE_SEND_FOR_CLIENT || mode == AURA_EFFECT_HANDLE_SEND_FOR_CLIENT
|| mode == AURA_EFFECT_HANDLE_CHANGE_AMOUNT || mode == AURA_EFFECT_HANDLE_CHANGE_AMOUNT
@@ -933,7 +933,7 @@ void AuraEffect::HandleEffect(AuraApplication const * aurApp, uint8 mode, bool a
void AuraEffect::HandleEffect(Unit * target, uint8 mode, bool apply) void AuraEffect::HandleEffect(Unit * target, uint8 mode, bool apply)
{ {
AuraApplication const * aurApp = GetBase()->GetApplicationOfTarget(target->GetGUID()); AuraApplication const * aurApp = GetBase()->GetApplicationOfTarget(target->GetGUID());
assert(aurApp); ASSERT(aurApp);
HandleEffect(aurApp, mode, apply); HandleEffect(aurApp, mode, apply);
} }
@@ -1169,7 +1169,7 @@ void AuraEffect::UpdatePeriodic(Unit * caster)
bool AuraEffect::IsPeriodicTickCrit(Unit * target, Unit const * caster) const bool AuraEffect::IsPeriodicTickCrit(Unit * target, Unit const * caster) const
{ {
assert(caster); ASSERT(caster);
Unit::AuraEffectList const& mPeriodicCritAuras= caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_PERIODIC_CRIT); Unit::AuraEffectList const& mPeriodicCritAuras= caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_PERIODIC_CRIT);
for (Unit::AuraEffectList::const_iterator itr = mPeriodicCritAuras.begin(); itr != mPeriodicCritAuras.end(); ++itr) for (Unit::AuraEffectList::const_iterator itr = mPeriodicCritAuras.begin(); itr != mPeriodicCritAuras.end(); ++itr)
{ {
+36 -36
View File
@@ -39,7 +39,7 @@ AuraApplication::AuraApplication(Unit * target, Unit * caster, Aura * aura, uint
: m_target(target), m_base(aura), m_slot(MAX_AURAS), m_flags(AFLAG_NONE), m_needClientUpdate(false) : m_target(target), m_base(aura), m_slot(MAX_AURAS), m_flags(AFLAG_NONE), m_needClientUpdate(false)
, m_removeMode(AURA_REMOVE_NONE), m_effectsToApply(effMask) , m_removeMode(AURA_REMOVE_NONE), m_effectsToApply(effMask)
{ {
assert(GetTarget() && GetBase()); ASSERT(GetTarget() && GetBase());
if (GetBase()->IsVisible()) if (GetBase()->IsVisible())
{ {
@@ -137,9 +137,9 @@ bool AuraApplication::_CheckPositive(Unit * /*caster*/) const
void AuraApplication::_HandleEffect(uint8 effIndex, bool apply) void AuraApplication::_HandleEffect(uint8 effIndex, bool apply)
{ {
AuraEffect * aurEff = GetBase()->GetEffect(effIndex); AuraEffect * aurEff = GetBase()->GetEffect(effIndex);
assert(aurEff); ASSERT(aurEff);
assert(HasEffect(effIndex) == (!apply)); ASSERT(HasEffect(effIndex) == (!apply));
assert((1<<effIndex) & m_effectsToApply); ASSERT((1<<effIndex) & m_effectsToApply);
sLog.outDebug("AuraApplication::_HandleEffect: %u, apply: %u: amount: %u", aurEff->GetAuraType(), apply, aurEff->GetAmount()); sLog.outDebug("AuraApplication::_HandleEffect: %u, apply: %u: amount: %u", aurEff->GetAuraType(), apply, aurEff->GetAmount());
Unit * caster = GetBase()->GetCaster(); Unit * caster = GetBase()->GetCaster();
@@ -177,13 +177,13 @@ void AuraApplication::ClientUpdate(bool remove)
if (remove) if (remove)
{ {
assert(!m_target->GetVisibleAura(m_slot)); ASSERT(!m_target->GetVisibleAura(m_slot));
data << uint32(0); data << uint32(0);
sLog.outDebug("Aura %u removed slot %u",GetBase()->GetId(), m_slot); sLog.outDebug("Aura %u removed slot %u",GetBase()->GetId(), m_slot);
m_target->SendMessageToSet(&data, true); m_target->SendMessageToSet(&data, true);
return; return;
} }
assert(m_target->GetVisibleAura(m_slot)); ASSERT(m_target->GetVisibleAura(m_slot));
Aura const * aura = GetBase(); Aura const * aura = GetBase();
data << uint32(aura->GetId()); data << uint32(aura->GetId());
@@ -208,10 +208,10 @@ void AuraApplication::ClientUpdate(bool remove)
Aura * Aura::TryCreate(SpellEntry const* spellproto, uint8 tryEffMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID) Aura * Aura::TryCreate(SpellEntry const* spellproto, uint8 tryEffMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID)
{ {
assert(spellproto); ASSERT(spellproto);
assert(owner); ASSERT(owner);
assert(caster || casterGUID); ASSERT(caster || casterGUID);
assert(tryEffMask <= MAX_EFFECT_MASK); ASSERT(tryEffMask <= MAX_EFFECT_MASK);
uint8 effMask = 0; uint8 effMask = 0;
switch(owner->GetTypeId()) switch(owner->GetTypeId())
{ {
@@ -238,9 +238,9 @@ Aura * Aura::TryCreate(SpellEntry const* spellproto, uint8 tryEffMask, WorldObje
Aura * Aura::TryCreate(SpellEntry const* spellproto, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID) Aura * Aura::TryCreate(SpellEntry const* spellproto, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID)
{ {
assert(spellproto); ASSERT(spellproto);
assert(owner); ASSERT(owner);
assert(caster || casterGUID); ASSERT(caster || casterGUID);
uint8 effMask = 0; uint8 effMask = 0;
switch(owner->GetTypeId()) switch(owner->GetTypeId())
{ {
@@ -267,11 +267,11 @@ Aura * Aura::TryCreate(SpellEntry const* spellproto, WorldObject * owner, Unit *
Aura * Aura::Create(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID) Aura * Aura::Create(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID)
{ {
assert(effMask); ASSERT(effMask);
assert(spellproto); ASSERT(spellproto);
assert(owner); ASSERT(owner);
assert(caster || casterGUID); ASSERT(caster || casterGUID);
assert(effMask <= MAX_EFFECT_MASK); ASSERT(effMask <= MAX_EFFECT_MASK);
// try to get caster of aura // try to get caster of aura
if (casterGUID) if (casterGUID)
{ {
@@ -291,7 +291,7 @@ Aura * Aura::Create(SpellEntry const* spellproto, uint8 effMask, WorldObject * o
aura = new DynObjAura(spellproto,effMask,owner,caster,baseAmount,castItem, casterGUID); aura = new DynObjAura(spellproto,effMask,owner,caster,baseAmount,castItem, casterGUID);
break; break;
default: default:
assert(false); ASSERT(false);
return NULL; return NULL;
} }
// aura can be removed in Unit::_AddAura call // aura can be removed in Unit::_AddAura call
@@ -345,7 +345,7 @@ Aura::~Aura()
for (uint8 i = 0 ; i < MAX_SPELL_EFFECTS; ++i) for (uint8 i = 0 ; i < MAX_SPELL_EFFECTS; ++i)
delete m_effects[i]; delete m_effects[i];
assert(m_applications.empty()); ASSERT(m_applications.empty());
_DeleteRemovedApplications(); _DeleteRemovedApplications();
} }
@@ -366,10 +366,10 @@ AuraObjectType Aura::GetType() const
void Aura::_ApplyForTarget(Unit * target, Unit * caster, AuraApplication * auraApp) void Aura::_ApplyForTarget(Unit * target, Unit * caster, AuraApplication * auraApp)
{ {
assert(target); ASSERT(target);
assert(auraApp); ASSERT(auraApp);
// aura mustn't be already applied // aura mustn't be already applied
assert (m_applications.find(target->GetGUID()) == m_applications.end()); ASSERT (m_applications.find(target->GetGUID()) == m_applications.end());
m_applications[target->GetGUID()] = auraApp; m_applications[target->GetGUID()] = auraApp;
@@ -386,9 +386,9 @@ void Aura::_ApplyForTarget(Unit * target, Unit * caster, AuraApplication * auraA
void Aura::_UnapplyForTarget(Unit * target, Unit * caster, AuraApplication * auraApp) void Aura::_UnapplyForTarget(Unit * target, Unit * caster, AuraApplication * auraApp)
{ {
assert(target); ASSERT(target);
assert(auraApp->GetRemoveMode()); ASSERT(auraApp->GetRemoveMode());
assert(auraApp); ASSERT(auraApp);
ApplicationMap::iterator itr = m_applications.find(target->GetGUID()); ApplicationMap::iterator itr = m_applications.find(target->GetGUID());
// TODO: Figure out why this happens. // TODO: Figure out why this happens.
@@ -401,7 +401,7 @@ void Aura::_UnapplyForTarget(Unit * target, Unit * caster, AuraApplication * aur
m_applications.erase(itr); m_applications.erase(itr);
// aura has to be already applied // aura has to be already applied
//assert(itr->second == auraApp); //ASSERT(itr->second == auraApp);
m_removedApplications.push_back(auraApp); m_removedApplications.push_back(auraApp);
// reset cooldown state for spells // reset cooldown state for spells
@@ -417,7 +417,7 @@ void Aura::_UnapplyForTarget(Unit * target, Unit * caster, AuraApplication * aur
// and marks aura as removed // and marks aura as removed
void Aura::_Remove(AuraRemoveMode removeMode) void Aura::_Remove(AuraRemoveMode removeMode)
{ {
assert (!m_isRemoved); ASSERT (!m_isRemoved);
m_isRemoved = true; m_isRemoved = true;
ApplicationMap::iterator appItr = m_applications.begin(); ApplicationMap::iterator appItr = m_applications.begin();
for (appItr = m_applications.begin(); appItr != m_applications.end();) for (appItr = m_applications.begin(); appItr != m_applications.end();)
@@ -506,7 +506,7 @@ void Aura::UpdateTargetMap(Unit * caster, bool apply)
else else
{ {
// owner has to be in world, or effect has to be applied to self // owner has to be in world, or effect has to be applied to self
assert((!GetOwner()->IsInWorld() && GetOwner() == itr->first) || GetOwner()->IsInMap(itr->first)); ASSERT((!GetOwner()->IsInWorld() && GetOwner() == itr->first) || GetOwner()->IsInMap(itr->first));
itr->first->_CreateAuraApplication(this, itr->second); itr->first->_CreateAuraApplication(this, itr->second);
++itr; ++itr;
} }
@@ -528,7 +528,7 @@ void Aura::UpdateTargetMap(Unit * caster, bool apply)
if (AuraApplication * aurApp = GetApplicationOfTarget(itr->first->GetGUID())) if (AuraApplication * aurApp = GetApplicationOfTarget(itr->first->GetGUID()))
{ {
// owner has to be in world, or effect has to be applied to self // owner has to be in world, or effect has to be applied to self
assert((!GetOwner()->IsInWorld() && GetOwner() == itr->first) || GetOwner()->IsInMap(itr->first)); ASSERT((!GetOwner()->IsInWorld() && GetOwner() == itr->first) || GetOwner()->IsInMap(itr->first));
itr->first->_ApplyAura(aurApp, itr->second); itr->first->_ApplyAura(aurApp, itr->second);
} }
} }
@@ -552,14 +552,14 @@ void Aura::_ApplyEffectForTargets(uint8 effIndex)
if (GetApplicationOfTarget((*itr)->GetGUID())) if (GetApplicationOfTarget((*itr)->GetGUID()))
{ {
// owner has to be in world, or effect has to be applied to self // owner has to be in world, or effect has to be applied to self
assert((!GetOwner()->IsInWorld() && GetOwner() == *itr) || GetOwner()->IsInMap(*itr)); ASSERT((!GetOwner()->IsInWorld() && GetOwner() == *itr) || GetOwner()->IsInMap(*itr));
(*itr)->_ApplyAuraEffect(this, effIndex); (*itr)->_ApplyAuraEffect(this, effIndex);
} }
} }
} }
void Aura::UpdateOwner(uint32 diff, WorldObject * owner) void Aura::UpdateOwner(uint32 diff, WorldObject * owner)
{ {
assert(owner == m_owner); ASSERT(owner == m_owner);
Unit * caster = GetCaster(); Unit * caster = GetCaster();
// Apply spellmods for channeled auras // Apply spellmods for channeled auras
@@ -759,7 +759,7 @@ bool Aura::IsVisible() const
void Aura::UnregisterSingleTarget() void Aura::UnregisterSingleTarget()
{ {
assert(m_isSingleTarget); ASSERT(m_isSingleTarget);
Unit * caster = GetCaster(); Unit * caster = GetCaster();
caster->GetSingleCastAuras().remove(this); caster->GetSingleCastAuras().remove(this);
SetIsSingleTarget(false); SetIsSingleTarget(false);
@@ -795,7 +795,7 @@ bool Aura::HasEffectType(AuraType type) const
void Aura::RecalculateAmountOfEffects() void Aura::RecalculateAmountOfEffects()
{ {
assert (!IsRemoved()); ASSERT (!IsRemoved());
Unit * caster = GetCaster(); Unit * caster = GetCaster();
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (m_effects[i]) if (m_effects[i])
@@ -804,7 +804,7 @@ void Aura::RecalculateAmountOfEffects()
void Aura::HandleAllEffects(AuraApplication const * aurApp, uint8 mode, bool apply) void Aura::HandleAllEffects(AuraApplication const * aurApp, uint8 mode, bool apply)
{ {
assert (!IsRemoved()); ASSERT (!IsRemoved());
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (m_effects[i] && !IsRemoved()) if (m_effects[i] && !IsRemoved())
m_effects[i]->HandleEffect(aurApp, mode, apply); m_effects[i]->HandleEffect(aurApp, mode, apply);
@@ -1492,7 +1492,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
bool Aura::CheckAreaTarget(Unit *target) bool Aura::CheckAreaTarget(Unit *target)
{ {
// for owner check use Spell::CheckTarget // for owner check use Spell::CheckTarget
assert(GetOwner() != target); ASSERT(GetOwner() != target);
// some special cases // some special cases
switch(GetId()) switch(GetId())
+4 -4
View File
@@ -65,7 +65,7 @@ class AuraApplication
uint8 GetSlot() const { return m_slot; } uint8 GetSlot() const { return m_slot; }
uint8 GetFlags() const { return m_flags; } uint8 GetFlags() const { return m_flags; }
uint8 GetEffectMask() const { return m_flags & (AFLAG_EFF_INDEX_0 | AFLAG_EFF_INDEX_1 | AFLAG_EFF_INDEX_2); } uint8 GetEffectMask() const { return m_flags & (AFLAG_EFF_INDEX_0 | AFLAG_EFF_INDEX_1 | AFLAG_EFF_INDEX_2); }
bool HasEffect(uint8 effect) const { assert(effect < MAX_SPELL_EFFECTS); return m_flags & (1<<effect); } bool HasEffect(uint8 effect) const { ASSERT(effect < MAX_SPELL_EFFECTS); return m_flags & (1<<effect); }
bool IsPositive() const { return m_flags & AFLAG_POSITIVE; } bool IsPositive() const { return m_flags & AFLAG_POSITIVE; }
uint8 GetEffectsToApply() const { return m_effectsToApply; } uint8 GetEffectsToApply() const { return m_effectsToApply; }
@@ -95,8 +95,8 @@ class Aura
uint64 const& GetCasterGUID() const { return m_casterGuid; } uint64 const& GetCasterGUID() const { return m_casterGuid; }
Unit* GetCaster() const; Unit* GetCaster() const;
WorldObject * GetOwner() const { return m_owner; } WorldObject * GetOwner() const { return m_owner; }
Unit * GetUnitOwner() const { assert(GetType() == UNIT_AURA_TYPE); return (Unit*)m_owner; } Unit * GetUnitOwner() const { ASSERT(GetType() == UNIT_AURA_TYPE); return (Unit*)m_owner; }
DynamicObject * GetDynobjOwner() const { assert(GetType() == DYNOBJ_AURA_TYPE); return (DynamicObject*)m_owner; } DynamicObject * GetDynobjOwner() const { ASSERT(GetType() == DYNOBJ_AURA_TYPE); return (DynamicObject*)m_owner; }
AuraObjectType GetType() const; AuraObjectType GetType() const;
@@ -150,7 +150,7 @@ class Aura
// helpers for aura effects // helpers for aura effects
bool HasEffect(uint8 effIndex) const { return bool(GetEffect(effIndex)); } bool HasEffect(uint8 effIndex) const { return bool(GetEffect(effIndex)); }
bool HasEffectType(AuraType type) const; bool HasEffectType(AuraType type) const;
AuraEffect * GetEffect (uint8 effIndex) const { assert (effIndex < MAX_SPELL_EFFECTS); return m_effects[effIndex]; } AuraEffect * GetEffect (uint8 effIndex) const { ASSERT (effIndex < MAX_SPELL_EFFECTS); return m_effects[effIndex]; }
uint8 GetEffectMask() const { uint8 effMask = 0; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (m_effects[i]) effMask |= 1<<i; return effMask; } uint8 GetEffectMask() const { uint8 effMask = 0; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (m_effects[i]) effMask |= 1<<i; return effMask; }
void RecalculateAmountOfEffects(); void RecalculateAmountOfEffects();
void HandleAllEffects(AuraApplication const * aurApp, uint8 mode, bool apply); void HandleAllEffects(AuraApplication const * aurApp, uint8 mode, bool apply);
+3 -3
View File
@@ -467,13 +467,13 @@ Spell::~Spell()
if (m_referencedFromCurrentSpell && m_selfContainer && *m_selfContainer == this) if (m_referencedFromCurrentSpell && m_selfContainer && *m_selfContainer == this)
{ {
// Clean the reference to avoid later crash. // Clean the reference to avoid later crash.
// If this error is repeating, we may have to add an assert to better track down how we get into this case. // If this error is repeating, we may have to add an ASSERT to better track down how we get into this case.
sLog.outError("SPELL: deleting spell for spell ID %u. However, spell still referenced.", m_spellInfo->Id); sLog.outError("SPELL: deleting spell for spell ID %u. However, spell still referenced.", m_spellInfo->Id);
*m_selfContainer = NULL; *m_selfContainer = NULL;
} }
if (m_caster && m_caster->GetTypeId() == TYPEID_PLAYER) if (m_caster && m_caster->GetTypeId() == TYPEID_PLAYER)
assert(m_caster->ToPlayer()->m_spellModTakingSpell != this); ASSERT(m_caster->ToPlayer()->m_spellModTakingSpell != this);
delete m_spellValue; delete m_spellValue;
} }
@@ -1402,7 +1402,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
if (scaleAura) if (scaleAura)
{ {
aurSpellInfo = spellmgr.SelectAuraRankForPlayerLevel(m_spellInfo,unitTarget->getLevel()); aurSpellInfo = spellmgr.SelectAuraRankForPlayerLevel(m_spellInfo,unitTarget->getLevel());
assert (aurSpellInfo); ASSERT (aurSpellInfo);
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{ {
basePoints[i] = aurSpellInfo->EffectBasePoints[i]; basePoints[i] = aurSpellInfo->EffectBasePoints[i];
+1 -1
View File
@@ -716,7 +716,7 @@ namespace Trinity
: i_source(source), i_data(&data), i_radius(radius), i_push_type(type) : i_source(source), i_data(&data), i_radius(radius), i_push_type(type)
, i_TargetType(TargetType), i_pos(pos), i_entry(entry) , i_TargetType(TargetType), i_pos(pos), i_entry(entry)
{ {
assert(i_source); ASSERT(i_source);
} }
template<class T> inline void Visit(GridRefManager<T> &m) template<class T> inline void Visit(GridRefManager<T> &m)
+5 -5
View File
@@ -2540,7 +2540,7 @@ void Spell::EffectApplyAura(uint32 i)
{ {
if (!m_spellAura || !unitTarget) if (!m_spellAura || !unitTarget)
return; return;
assert(unitTarget == m_spellAura->GetOwner()); ASSERT(unitTarget == m_spellAura->GetOwner());
m_spellAura->_ApplyEffectForTargets(i); m_spellAura->_ApplyEffectForTargets(i);
} }
@@ -2548,7 +2548,7 @@ void Spell::EffectApplyAreaAura(uint32 i)
{ {
if (!m_spellAura || !unitTarget) if (!m_spellAura || !unitTarget)
return; return;
assert (unitTarget == m_spellAura->GetOwner()); ASSERT (unitTarget == m_spellAura->GetOwner());
m_spellAura->_ApplyEffectForTargets(i); m_spellAura->_ApplyEffectForTargets(i);
} }
@@ -3067,12 +3067,12 @@ void Spell::EffectPersistentAA(uint32 i)
m_spellAura = aura; m_spellAura = aura;
else else
{ {
assert(false); ASSERT(false);
return; return;
} }
m_spellAura->_RegisterForTargets(); m_spellAura->_RegisterForTargets();
} }
assert(m_spellAura->GetDynobjOwner()); ASSERT(m_spellAura->GetDynobjOwner());
m_spellAura->_ApplyEffectForTargets(i); m_spellAura->_ApplyEffectForTargets(i);
} }
@@ -4265,7 +4265,7 @@ void Spell::EffectSummonPet(uint32 i)
if (OldSummon->isDead()) if (OldSummon->isDead())
return; return;
assert(OldSummon->GetMap() == owner->GetMap()); ASSERT(OldSummon->GetMap() == owner->GetMap());
//OldSummon->GetMap()->Remove(OldSummon->ToCreature(),false); //OldSummon->GetMap()->Remove(OldSummon->ToCreature(),false);
+2 -2
View File
@@ -34,9 +34,9 @@
#endif #endif
#ifdef HAVE_ACE_STACK_TRACE_H // old versions ACE not have Stack_Trace.h but used at some oS for better compatibility #ifdef HAVE_ACE_STACK_TRACE_H // old versions ACE not have Stack_Trace.h but used at some oS for better compatibility
#define WPAssert( assertion ) { if (!(assertion)) { ACE_Stack_Trace st; fprintf( stderr, "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", __FILE__, __LINE__,__FUNCTION__, #assertion, st.c_str()); assert( #assertion &&0 ); } } #define WPAssert( assertion ) { if (!(assertion)) { ACE_Stack_Trace st; fprintf( stderr, "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", __FILE__, __LINE__,__FUNCTION__, #assertion, st.c_str()); assert( #assertion &&0 ); ((void(*)())NULL)();} }
#else #else
#define WPAssert( assertion ) { if (!(assertion)) { fprintf( stderr, "\n%s:%i in %s ASSERTION FAILED2:\n %s\n", __FILE__, __LINE__,__FUNCTION__, #assertion); assert( #assertion &&0 ); } } #define WPAssert( assertion ) { if (!(assertion)) { fprintf( stderr, "\n%s:%i in %s ASSERTION FAILED2:\n %s\n", __FILE__, __LINE__,__FUNCTION__, #assertion); assert( #assertion &&0 ); ((void(*)())NULL)();} }
#endif #endif
#define WPError( assertion, errmsg ) if( ! (assertion) ) { sLog.outError( "%\n%s:%i in %s ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); assert( false ); } #define WPError( assertion, errmsg ) if( ! (assertion) ) { sLog.outError( "%\n%s:%i in %s ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); assert( false ); }
#define WPWarning( assertion, errmsg ) if( ! (assertion) ) { sLog.outError( "\n%s:%i in %s WARNING:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); } #define WPWarning( assertion, errmsg ) if( ! (assertion) ) { sLog.outError( "\n%s:%i in %s WARNING:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); }