diff options
author | QAston <none@none> | 2010-07-30 20:04:28 +0200 |
---|---|---|
committer | QAston <none@none> | 2010-07-30 20:04:28 +0200 |
commit | 48b360097c2bd6a6ce9ffd1e96746c7b04ae420d (patch) | |
tree | a3978389097963393417d93e85d3bca50eb3aff5 | |
parent | 3dc29732b7dabab22c0b30581a141cb56074f099 (diff) |
*use ASSERT macro instead of regular assert for better output.
--HG--
branch : trunk
50 files changed, 261 insertions, 261 deletions
diff --git a/src/server/game/AI/CoreAI/TotemAI.cpp b/src/server/game/AI/CoreAI/TotemAI.cpp index a6464f189e8..bfa9d15d33f 100644 --- a/src/server/game/AI/CoreAI/TotemAI.cpp +++ b/src/server/game/AI/CoreAI/TotemAI.cpp @@ -40,7 +40,7 @@ TotemAI::Permissible(const Creature *creature) TotemAI::TotemAI(Creature *c) : CreatureAI(c), i_victimGuid(0) { - assert(c->isTotem()); + ASSERT(c->isTotem()); } void diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp index 8283baf87f9..67e3e42f2ae 100644 --- a/src/server/game/AI/CreatureAISelector.cpp +++ b/src/server/game/AI/CreatureAISelector.cpp @@ -84,7 +84,7 @@ namespace FactorySelector { const CreatureAICreator *factory = iter->second; const SelectableAI *p = dynamic_cast<const SelectableAI *>(factory); - assert(p != NULL); + ASSERT(p != NULL); int val = p->Permit(creature); if (val > best_val) { @@ -104,7 +104,7 @@ namespace FactorySelector MovementGenerator* selectMovementGenerator(Creature *creature) { MovementGeneratorRegistry& mv_registry(*MovementGeneratorRepository::instance()); - assert(creature->GetCreatureInfo() != NULL); + ASSERT(creature->GetCreatureInfo() != NULL); const MovementGeneratorCreator *mv_factory = mv_registry.GetRegistryItem(creature->GetDefaultMovementType()); /* if (mv_factory == NULL) @@ -116,7 +116,7 @@ namespace FactorySelector { const MovementGeneratorCreator *factory = mv_registry.GetRegistryItem((*iter).c_str()); const SelectableMovement *p = dynamic_cast<const SelectableMovement *>(factory); - assert(p != NULL); + ASSERT(p != NULL); int val = p->Permit(creature); if (val > best_val) { diff --git a/src/server/game/BattleGrounds/Zones/BattleGroundAV.cpp b/src/server/game/BattleGrounds/Zones/BattleGroundAV.cpp index b477d6723fe..67725fd3f39 100644 --- a/src/server/game/BattleGrounds/Zones/BattleGroundAV.cpp +++ b/src/server/game/BattleGrounds/Zones/BattleGroundAV.cpp @@ -240,7 +240,7 @@ void BattleGroundAV::HandleQuestComplete(uint32 questid, Player *player) void BattleGroundAV::UpdateScore(uint16 team, int16 points) { //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 m_Team_Scores[teamindex] += points; @@ -266,7 +266,7 @@ Creature* BattleGroundAV::AddAVCreature(uint16 cinfoid, uint16 type) uint8 level; bool isStatic = false; 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 { type -= AV_CPLACE_MAX; @@ -630,7 +630,7 @@ void BattleGroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node) void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) { //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 - assert(mine == AV_NORTH_MINE || mine == AV_SOUTH_MINE); + ASSERT(mine == AV_NORTH_MINE || mine == AV_SOUTH_MINE); if (team != ALLIANCE && team != HORDE) team = AV_NEUTRAL_TEAM; else @@ -729,7 +729,7 @@ bool BattleGroundAV::PlayerCanDoMineQuest(int32 GOId,uint32 team) void BattleGroundAV::PopulateNode(BG_AV_Nodes node) { uint32 owner = m_Nodes[node].Owner; - assert(owner); + ASSERT(owner); uint32 c_place = AV_CPLACE_DEFENSE_STORM_AID + (4 * node); uint32 creatureid; @@ -809,7 +809,7 @@ const BG_AV_Nodes BattleGroundAV::GetNodeThroughObject(uint32 object) if (object == BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE) return BG_AV_NODES_SNOWFALL_GRAVE; sLog.outError("BattleGroundAV: ERROR! GetPlace got a wrong object :("); - assert(false); + ASSERT(false); 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) return BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE; sLog.outError("BattleGroundAV: Error! GetPlaceNode couldn't resolve node %i",node); - assert(false); + ASSERT(false); return 0; } @@ -881,7 +881,7 @@ void BattleGroundAV::EventPlayerClickedOnFlag(Player *source, GameObject* target void BattleGroundAV::EventPlayerDefendsPoint(Player* player, uint32 object) { - assert(GetStatus() == STATUS_IN_PROGRESS); + ASSERT(GetStatus() == STATUS_IN_PROGRESS); BG_AV_Nodes node = GetNodeThroughObject(object); uint32 owner = m_Nodes[node].Owner; //maybe should name it prevowner @@ -891,7 +891,7 @@ void BattleGroundAV::EventPlayerDefendsPoint(Player* player, uint32 object) return; if (m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM) { //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); return; } @@ -952,7 +952,7 @@ void BattleGroundAV::EventPlayerDefendsPoint(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); 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 { - 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) SpawnBGObject(BG_AV_OBJECT_FLAG_C_A_SNOWFALL_GRAVE, RESPAWN_IMMEDIATELY); 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 { - assert(m_Nodes[node].State != POINT_CONTROLED); + ASSERT(m_Nodes[node].State != POINT_CONTROLED); if (team == ALLIANCE) SpawnBGObject(object-11, RESPAWN_IMMEDIATELY); 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 (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) SpawnBGObject(object-22, RESPAWN_IMMEDIATELY); 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 { //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 if (team == ALLIANCE) { @@ -1129,10 +1129,10 @@ void BattleGroundAV::UpdateNodeWorldState(BG_AV_Nodes node) 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 (: -// 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_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); 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; @@ -1396,22 +1396,22 @@ void BattleGroundAV::AssaultNode(BG_AV_Nodes node, uint16 team) if (m_Nodes[node].TotalOwner == team) { sLog.outCrash("Assaulting team is TotalOwner of node"); - assert (false); + ASSERT (false); } if (m_Nodes[node].Owner == team) { sLog.outCrash("Assaulting team is owner of node"); - assert (false); + ASSERT (false); } if (m_Nodes[node].State == POINT_DESTROYED) { 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 { 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 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) { - 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].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) { - assert(m_Nodes[node].TotalOwner == team); - assert(m_Nodes[node].Owner != team); - assert(m_Nodes[node].State != POINT_CONTROLED && m_Nodes[node].State != POINT_DESTROYED); + ASSERT(m_Nodes[node].TotalOwner == team); + ASSERT(m_Nodes[node].Owner != team); + ASSERT(m_Nodes[node].State != POINT_CONTROLED && m_Nodes[node].State != POINT_DESTROYED); m_Nodes[node].PrevOwner = m_Nodes[node].Owner; m_Nodes[node].Owner = team; m_Nodes[node].PrevState = m_Nodes[node].State; diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index fbf5a80d42b..a152ff96f89 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -280,7 +280,7 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* pAttacker, Hostile currentRef = (*iter); 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 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()) return; - assert(getOwner()->GetTypeId() == TYPEID_UNIT); + ASSERT(getOwner()->GetTypeId() == TYPEID_UNIT); float threat = ThreatCalcHelper::calcThreat(pVictim, iOwner, fThreat, schoolMask, pThreatSpell); diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index 1900626dff5..bf42cf25168 100644 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -185,7 +185,7 @@ void DisableMgr::CheckQuestDisables() 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()) return false; diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 022f5b3d2f0..479647b159f 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -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); - // assert must fail after function call + // ASSERT must fail after function call 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) { // 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; SqlDbc * sql = NULL; @@ -361,7 +361,7 @@ void LoadDBCStores(const std::string& dataPath) for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i) if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i)) 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,sQuestFactionRewardStore, dbcPath,"QuestFactionReward.dbc"); diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 6c089a83bc3..700685f6c5f 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -358,7 +358,7 @@ void LFGMgr::Join(Player *plr) void LFGMgr::Leave(Player *plr, Group *grp /* = NULL*/) { uint64 guid = grp ? grp->GetGUID() : plr ? plr->GetGUID() : 0; - assert(guid); + ASSERT(guid); // Check if player was in a rolecheck if (grp) @@ -405,7 +405,7 @@ void LFGMgr::Leave(Player *plr, Group *grp /* = NULL*/) /// <param name="plr">Player</param> void LFGMgr::UpdateRoleCheck(Group *grp, Player *plr /* = NULL*/) { - assert(grp); + ASSERT(grp); uint32 rolecheckId = GUID_LOPART(grp->GetGUID()); LfgRoleCheck *pRoleCheck = NULL; @@ -685,7 +685,7 @@ bool LFGMgr::CheckGroupRoles(LfgRolesMap &groles, bool removeLeaderFlag /*= true /// <param name="status">Player status in LFG system</param> void LFGMgr::BuildLfgRoleCheck(WorldPacket &data, LfgRoleCheck *pRoleCheck) { - assert(pRoleCheck); + ASSERT(pRoleCheck); Player *plr; uint8 roles; @@ -818,7 +818,7 @@ void LFGMgr::BuildRewardBlock(WorldPacket &data, uint32 dungeon, Player *plr) /// <param name="lock">lock status map</param> void LFGMgr::BuildPartyLockDungeonBlock(WorldPacket &data, LfgLockStatusMap *lockMap) { - assert(lockMap); + ASSERT(lockMap); data << uint8(lockMap->size()); @@ -845,7 +845,7 @@ void LFGMgr::BuildPartyLockDungeonBlock(WorldPacket &data, LfgLockStatusMap *loc /// <param name="lock">lock status list</param> void LFGMgr::BuildPlayerLockDungeonBlock(WorldPacket &data, LfgLockStatusSet *lockSet) { - assert(lockSet); + ASSERT(lockSet); data << uint32(lockSet->size()); // Size of lock dungeons for (LfgLockStatusSet::iterator it = lockSet->begin(); it != lockSet->end(); ++it) { @@ -873,8 +873,8 @@ void LFGMgr::BuildPlayerLockDungeonBlock(WorldPacket &data, LfgLockStatusSet *lo /// <returns>LfgLockStatusMap*</returns> LfgLockStatusMap* LFGMgr::GetPartyLockStatusDungeons(Player *plr, LfgDungeonSet *dungeons) { - assert(plr); - assert(dungeons); + ASSERT(plr); + ASSERT(dungeons); Group *grp = plr->GetGroup(); if (!grp) return NULL; @@ -919,7 +919,7 @@ LfgLockStatusSet* LFGMgr::GetPlayerLockStatusDungeons(Player *plr, LfgDungeonSet for (LfgDungeonSet::const_iterator it = dungeons->begin(); it != dungeons->end(); ++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; if (dungeon->expansion > expansion) diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index caa9d4bf895..8c8825b3bff 100644 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -137,7 +137,7 @@ void Corpse::SaveToDB() void Corpse::DeleteBonesFromWorld() { - assert(GetType() == CORPSE_BONES); + ASSERT(GetType() == CORPSE_BONES); Corpse* corpse = ObjectAccessor::GetCorpse(*this, GetGUID()); if (!corpse) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 4012edcd81c..a856af44636 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1959,7 +1959,7 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction / // friendlies and other mobs they shouldn't attack bool Creature::_IsTargetAcceptable(const Unit *target) const { - assert(target); + ASSERT(target); // if the target cannot be attacked, the target is not acceptable if (IsFriendlyTo(target) diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp index 11652460fc5..3179d1952ec 100644 --- a/src/server/game/Entities/Creature/TemporarySummon.cpp +++ b/src/server/game/Entities/Creature/TemporarySummon.cpp @@ -168,7 +168,7 @@ void TempSummon::Update(uint32 diff) void TempSummon::InitStats(uint32 duration) { - assert(!isPet()); + ASSERT(!isPet()); m_timer = duration; m_lifetime = duration; @@ -228,11 +228,11 @@ void TempSummon::SetTempSummonType(TempSummonType type) void TempSummon::UnSummon() { - //assert(!isPet()); + //ASSERT(!isPet()); if (isPet()) { ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT); - assert(!IsInWorld()); + ASSERT(!IsInWorld()); return; } @@ -267,7 +267,7 @@ void TempSummon::SaveToDB() Minion::Minion(SummonPropertiesEntry const *properties, Unit *owner) : TempSummon(properties, owner) , m_owner(owner) { - assert(m_owner); + ASSERT(m_owner); m_unitTypeMask |= UNIT_MASK_MINION; m_followAngle = PET_FOLLOW_ANGLE; } @@ -333,7 +333,7 @@ void Guardian::InitSummon() 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_unitTypeMask |= UNIT_MASK_PUPPET; } @@ -349,7 +349,7 @@ void Puppet::InitSummon() { Minion::InitSummon(); if (!SetCharmedBy(m_owner, CHARM_TYPE_POSSESS)) - assert(false); + ASSERT(false); } void Puppet::Update(uint32 time) diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.h b/src/server/game/Entities/DynamicObject/DynamicObject.h index 9a70407fd2d..970052b9a80 100644 --- a/src/server/game/Entities/DynamicObject/DynamicObject.h +++ b/src/server/game/Entities/DynamicObject/DynamicObject.h @@ -40,7 +40,7 @@ class DynamicObject : public WorldObject, public GridObject<DynamicObject> void Delete(); void SetDuration(int32 newDuration); 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); uint32 GetSpellId() const { return GetUInt32Value(DYNAMICOBJECT_SPELLID); } uint64 GetCasterGUID() const { return GetUInt64Value(DYNAMICOBJECT_CASTER); } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 3361f4c40f7..1dac4ba5e2e 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -551,7 +551,7 @@ void GameObject::Delete() if (Unit * owner = GetOwner()) owner->RemoveGameObject(this, false); - assert (!GetOwnerGUID()); + ASSERT (!GetOwnerGUID()); SendObjectDeSpawnAnim(GetGUID()); SetGoState(GO_STATE_READY); diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index ccb2a42399d..e466320df71 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -634,7 +634,7 @@ class GameObject : public WorldObject, public GridObject<GameObject> // Owner already found and different than expected owner - remove object from old owner if (owner && GetOwnerGUID() && GetOwnerGUID() != owner) { - assert(false); + ASSERT(false); } m_spawnedByDefault = false; // all object with owner is despawned after delay SetUInt64Value(OBJECT_FIELD_CREATED_BY, owner); diff --git a/src/server/game/Entities/Item/Container/Bag.cpp b/src/server/game/Entities/Item/Container/Bag.cpp index dffb1881ff6..4a4d3c50d84 100644 --- a/src/server/game/Entities/Item/Container/Bag.cpp +++ b/src/server/game/Entities/Item/Container/Bag.cpp @@ -147,7 +147,7 @@ uint32 Bag::GetFreeSlots() const void Bag::RemoveItem(uint8 slot, bool /*update*/) { - assert(slot < MAX_BAG_SIZE); + ASSERT(slot < MAX_BAG_SIZE); if (m_bagslot[slot]) 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*/) { - assert(slot < MAX_BAG_SIZE); + ASSERT(slot < MAX_BAG_SIZE); if (pItem && pItem->GetGUID() != this->GetGUID()) { diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 4d34a35dfb3..91df6372d09 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -165,7 +165,7 @@ void RemoveItemsSetItem(Player*player,ItemPrototype const *proto) if (!eff->item_count) //all items of a set were removed { - assert(eff == player->ItemSetEff[setindex]); + ASSERT(eff == player->ItemSetEff[setindex]); delete eff; player->ItemSetEff[setindex] = NULL; } @@ -1031,7 +1031,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player) if (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); 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; } else - assert(false); + ASSERT(false); return NULL; } diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index f173e48a254..ad4e9d0cfd1 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -89,7 +89,7 @@ WorldObject::~WorldObject() if (GetTypeId() == TYPEID_CORPSE) { sLog.outCrash("Object::~Object Corpse guid="UI64FMTD", type=%d, entry=%u deleted but still in map!!", GetGUID(), ((Corpse*)this)->GetType(), GetEntry()); - assert(false); + ASSERT(false); } 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()); if (isType(TYPEMASK_ITEM)) sLog.outCrash("Item slot %u", ((Item*)this)->GetSlot()); - assert(false); + ASSERT(false); RemoveFromWorld(); } if (m_objectUpdated) { sLog.outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in update list!!", GetGUID(), GetTypeId(), GetEntry()); - assert(false); + ASSERT(false); sObjectAccessor.RemoveUpdateObject(this); } @@ -743,7 +743,7 @@ void Object::BuildFieldsUpdate(Player *pl, UpdateDataMapType &data_map) const if (iter == data_map.end()) { std::pair<UpdateDataMapType::iterator, bool> p = data_map.insert(UpdateDataMapType::value_type(pl, UpdateData())); - assert(p.second); + ASSERT(p.second); 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); - // assert must fail after function call + // ASSERT must fail after function call return false; } @@ -1683,7 +1683,7 @@ void WorldObject::SetMap(Map * map) if (m_currMap) { sLog.outCrash("WorldObject::SetMap: obj %u new map %u %u, old map %u %u", (uint32)GetTypeId(), map->GetId(), map->GetInstanceId(), m_currMap->GetId(), m_currMap->GetInstanceId()); - assert(false); + ASSERT(false); } m_currMap = map; m_mapId = map->GetId(); @@ -1712,7 +1712,7 @@ Map const* WorldObject::GetBaseMap() const void WorldObject::AddObjectToRemoveList() { - assert(m_uint32Values); + ASSERT(m_uint32Values); Map* map = FindMap(); if (!map) diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 1d900a0bbc7..63f1a1eb487 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -129,7 +129,7 @@ class Object if (m_inWorld) return; - assert(m_uint32Values); + ASSERT(m_uint32Values); m_inWorld = true; diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 5d4f0b8860e..61617f7f12d 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -745,7 +745,7 @@ void Pet::GivePetLevel(uint8 level) bool Pet::CreateBaseAtCreature(Creature* creature) { - assert(creature); + ASSERT(creature); if (!CreateBaseAtTamed(creature->GetCreatureInfo(), creature->GetMap(), creature->GetPhaseMask())) return false; @@ -819,7 +819,7 @@ bool Pet::CreateBaseAtTamed(CreatureInfo const * cinfo, Map * map, uint32 phaseM bool Guardian::InitStatsForLevel(uint8 petlevel) { CreatureInfo const *cinfo = GetCreatureInfo(); - assert(cinfo); + ASSERT(cinfo); 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) { - assert(map); + ASSERT(map); SetMap(map); SetPhaseMask(phaseMask,false); diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h index 72ae2d678c4..36e4b7ce727 100644 --- a/src/server/game/Entities/Pet/Pet.h +++ b/src/server/game/Entities/Pet/Pet.h @@ -246,11 +246,11 @@ class Pet : public Guardian private: 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 { - assert(false); + ASSERT(false); } }; #endif diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 25c4bebe2ce..d6f8b33ccb0 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1257,7 +1257,7 @@ void Player::Update(uint32 p_time) // 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 - //assert (!m_spellModTakingSpell); + //ASSERT (!m_spellModTakingSpell); if ( m_spellModTakingSpell) { //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!"); 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 const MapEntry *entry = sMapStore.LookupEntry(corpse->GetMapId()); - assert(entry); + ASSERT(entry); if (entry->map_type != MAP_BATTLEGROUND) corpse->SaveToDB(); @@ -9177,7 +9177,7 @@ void Player::ResetPetTalents() void Player::SetVirtualItemSlot(uint8 i, Item* item) { - assert(i < 3); + ASSERT(i < 3); if (i < 2 && item) { 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) { - assert(itr->item); + ASSERT(itr->item); next = itr; 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) { uint16 log_slot = FindQuestSlot(0); - assert(log_slot < MAX_QUEST_LOG_SIZE); + ASSERT(log_slot < MAX_QUEST_LOG_SIZE); 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 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) { @@ -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 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) { @@ -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 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) { @@ -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) { - 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 ]; if (entry < 0) @@ -16160,7 +16160,7 @@ bool Player::LoadFromDB(uint32 guid, SqlQueryHolder *holder) TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(node_id); if (nodeEntry && nodeEntry->map_id == GetMapId()) { - assert(nodeEntry); // checked in m_taxi.LoadTaxiDestinationsFromString + ASSERT(nodeEntry); // checked in m_taxi.LoadTaxiDestinationsFromString mapId = nodeEntry->map_id; Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z,0.0f); } @@ -17440,7 +17440,7 @@ void Player::ConvertInstancesToGroup(Player *player, Group *group, uint64 player if (!group) group = player->GetGroup(); } - assert(player_guid); + ASSERT(player_guid); // copy all binds to the group, when changing leader it's assumed the character // will not have any solo binds @@ -18614,7 +18614,7 @@ void Player::StopCastingCharm() if (charm->GetCharmerGUID()) { sLog.outCrash("Charmed unit has charmer guid " UI64FMTD, charm->GetCharmerGUID()); - assert(false); + ASSERT(false); } else 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 // 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 { // 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.setSubGroup((uint8)subgroup); } @@ -22146,7 +22146,7 @@ void Player::SetOriginalGroup(Group *group, int8 subgroup) else { // 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.setSubGroup((uint8)subgroup); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index cdcd20910ea..e0c7271def9 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -329,7 +329,7 @@ struct EnchantDuration { EnchantDuration() : item(NULL), slot(MAX_ENCHANTMENT_SLOT), leftduration(0) {}; EnchantDuration(Item * _item, EnchantmentSlot _slot, uint32 _leftduration) : item(_item), slot(_slot), - leftduration(_leftduration){ assert(item); }; + leftduration(_leftduration){ ASSERT(item); }; Item * item; EnchantmentSlot slot; @@ -1518,7 +1518,7 @@ class Player : public Unit, public GridObject<Player> void AddMItem(Item* 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; } @@ -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 if (!mod->ownerAura) - assert(mod->charges == 0); + ASSERT(mod->charges == 0); if (!IsAffectedBySpellmod(spellInfo,mod,spell)) continue; diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 2a82b5c33df..53272a1eda1 100644 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -457,7 +457,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z) ResetMap(); Map * newMap = sMapMgr.CreateMap(newMapid, this, 0); SetMap(newMap); - assert (GetMap()); + ASSERT (GetMap()); if (oldMap != newMap) { diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 62886ccd9d8..e0d1ba85327 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -206,13 +206,13 @@ Unit::~Unit() delete m_charmInfo; delete m_vehicleKit; - assert(!m_attacking); - assert(m_attackers.empty()); - assert(m_sharedVision.empty()); - assert(m_Controlled.empty()); - assert(m_appliedAuras.empty()); - assert(m_ownedAuras.empty()); - assert(m_removedAuras.empty()); + ASSERT(!m_attacking); + ASSERT(m_attackers.empty()); + ASSERT(m_sharedVision.empty()); + ASSERT(m_Controlled.empty()); + ASSERT(m_appliedAuras.empty()); + ASSERT(m_ownedAuras.empty()); + ASSERT(m_removedAuras.empty()); } 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 // Having this would prevent spells from being proced, so let's crash - assert(!m_procDeep); + ASSERT(!m_procDeep); if (CanHaveThreatList() && getThreatManager().isNeedUpdateToClient(p_time)) SendThreatListUpdate(); @@ -812,10 +812,10 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa // last damage from duel opponent if (duel_hasEnded) { - assert(pVictim->GetTypeId() == TYPEID_PLAYER); + ASSERT(pVictim->GetTypeId() == TYPEID_PLAYER); Player *he = (Player*)pVictim; - assert(he->duel); + ASSERT(he->duel); he->SetHealth(1); @@ -3362,7 +3362,7 @@ void Unit::_UpdateAutoRepeatSpell() 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(); @@ -3435,7 +3435,7 @@ void Unit::SetCurrentCastedSpell(Spell * pSpell) 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()); Spell *spell = m_currentSpells[spellType]; @@ -3577,7 +3577,7 @@ void Unit::DeMorph() void Unit::_AddAura(UnitAura * aura, Unit * caster) { - assert(!m_cleanupDone); + ASSERT(!m_cleanupDone); 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 @@ -3642,9 +3642,9 @@ void Unit::_AddAura(UnitAura * aura, Unit * caster) 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 - assert(!m_cleanupDone); + ASSERT(!m_cleanupDone); // aura musn't be removed - assert(!aura->IsRemoved()); + ASSERT(!aura->IsRemoved()); SpellEntry const* aurSpellInfo = aura->GetSpellProto(); uint32 aurId = aurSpellInfo->Id; @@ -3674,10 +3674,10 @@ AuraApplication * Unit::_CreateAuraApplication(Aura * aura, uint8 effMask) void Unit::_ApplyAuraEffect(Aura * aura, uint8 effIndex) { - assert(aura); - assert(aura->HasEffect(effIndex)); + ASSERT(aura); + ASSERT(aura->HasEffect(effIndex)); AuraApplication * aurApp = aura->GetApplicationOfTarget(GetGUID()); - assert(aurApp); + ASSERT(aurApp); if (!aurApp->GetEffectMask()) _ApplyAura(aurApp, 1<<effIndex); else @@ -3725,15 +3725,15 @@ void Unit::_ApplyAura(AuraApplication * aurApp, uint8 effMask) void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode) { AuraApplication * aurApp = i->second; - assert(aurApp); - assert(!aurApp->GetRemoveMode()); - assert(aurApp->GetTarget() == this); + ASSERT(aurApp); + ASSERT(!aurApp->GetRemoveMode()); + ASSERT(aurApp->GetTarget() == this); aurApp->SetRemoveMode(removeMode); Aura * aura = aurApp->GetBase(); sLog.outDebug("Aura %u now is remove mode %d", aura->GetId(), removeMode); // dead loop is killing the server probably - assert(m_removedAurasCount < 0xFFFFFFFF); + ASSERT(m_removedAurasCount < 0xFFFFFFFF); ++m_removedAurasCount; @@ -3779,7 +3779,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo } // all effect mustn't be applied - assert(!aurApp->GetEffectMask()); + ASSERT(!aurApp->GetEffectMask()); // 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()) @@ -3802,7 +3802,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo void Unit::_UnapplyAura(AuraApplication * aurApp, AuraRemoveMode removeMode) { // 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(); 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 ++iter; } - assert(false); + ASSERT(false); } void Unit::_RemoveNoStackAuraApplicationsDueToAura(Aura * aura) @@ -3938,7 +3938,7 @@ void Unit::_HandleAuraEffect(AuraEffect * aurEff, bool apply) void Unit::RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode) { 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 (m_auraUpdateIterator == i) @@ -3973,7 +3973,7 @@ void Unit::RemoveOwnedAura(Aura * aura, AuraRemoveMode removeMode) if (aura->IsRemoved()) return; - assert(aura->GetOwner() == this); + ASSERT(aura->GetOwner() == this); uint32 spellId = aura->GetId(); 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); return; } - assert(false); + ASSERT(false); } 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) { - assert(aurApp->GetBase()->GetApplicationOfTarget(GetGUID()) == aurApp); + ASSERT(aurApp->GetBase()->GetApplicationOfTarget(GetGUID()) == aurApp); // no need to remove if (aurApp->GetRemoveMode() || aurApp->GetBase()->IsRemoved()) return; @@ -4048,7 +4048,7 @@ void Unit::RemoveAura(Aura * aura, AuraRemoveMode mode) if (AuraApplication * aurApp = aura->GetApplicationOfTarget(GetGUID())) RemoveAura(aurApp, mode); else - assert(false); + ASSERT(false); } 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()) continue; - //assert((*itr)->GetOwnerGUID() == GetGUID()); + //ASSERT((*itr)->GetOwnerGUID() == GetGUID()); if ((*itr)->GetOwnerGUID() != GetGUID()) { OutDebugInfo(); (*itr)->OutDebugInfo(); - assert(false); + ASSERT(false); } - assert((*itr)->GetTypeId() == TYPEID_UNIT); + ASSERT((*itr)->GetTypeId() == TYPEID_UNIT); if (!(*itr)->HasUnitTypeMask(UNIT_MASK_CONTROLABLE_GUARDIAN)) continue; @@ -11765,7 +11765,7 @@ bool Unit::isTargetableForAttack() const bool Unit::canAttack(Unit const* target, bool force) const { - assert(target); + ASSERT(target); if (force) { @@ -12364,7 +12364,7 @@ void Unit::DeleteThreatList() void Unit::TauntApply(Unit* taunter) { - assert(GetTypeId() == TYPEID_UNIT); + ASSERT(GetTypeId() == TYPEID_UNIT); if (!taunter || (taunter->GetTypeId() == TYPEID_PLAYER && taunter->ToPlayer()->isGameMaster())) return; @@ -12390,7 +12390,7 @@ void Unit::TauntApply(Unit* taunter) void Unit::TauntFadeOut(Unit *taunter) { - assert(GetTypeId() == TYPEID_UNIT); + ASSERT(GetTypeId() == TYPEID_UNIT); if (!taunter || (taunter->GetTypeId() == TYPEID_PLAYER && taunter->ToPlayer()->isGameMaster())) return; @@ -13287,7 +13287,7 @@ void Unit::AddToWorld() void Unit::RemoveFromWorld() { // cleanup - assert(GetGUID()); + ASSERT(GetGUID()); if (IsInWorld()) { @@ -13310,7 +13310,7 @@ void Unit::RemoveFromWorld() if (GetCharmerGUID()) { sLog.outCrash("Unit %u has charmer guid when removed from world", GetEntry()); - assert(false); + ASSERT(false); } if (Unit *owner = GetOwner()) @@ -13318,7 +13318,7 @@ void Unit::RemoveFromWorld() 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()); - assert(false); + ASSERT(false); } } @@ -13331,7 +13331,7 @@ void Unit::CleanupsBeforeDelete(bool finalCleanup) if (IsInWorld()) RemoveFromWorld(); - assert(GetGUID()); + ASSERT(GetGUID()); //A unit may be in removelist and not in world, but it is still in grid //and may have some references during delete @@ -13918,7 +13918,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, continue; AuraEffect *triggeredByAura = i->aura->GetEffect(effIndex); - assert(triggeredByAura); + ASSERT(triggeredByAura); switch(triggeredByAura->GetAuraType()) { @@ -15274,8 +15274,8 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type) if (GetTypeId() == TYPEID_PLAYER) Unmount(); - assert(type != CHARM_TYPE_POSSESS || charmer->GetTypeId() == TYPEID_PLAYER); - assert((type == CHARM_TYPE_VEHICLE) == IsVehicle()); + ASSERT(type != CHARM_TYPE_POSSESS || charmer->GetTypeId() == TYPEID_PLAYER); + 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)); @@ -15411,7 +15411,7 @@ void Unit::RemoveCharmedBy(Unit *charmer) { // sLog.outCrash("Unit::RemoveCharmedBy: this: " UI64FMTD " true charmer: " UI64FMTD " false charmer: " UI64FMTD, // GetGUID(), GetCharmerGUID(), charmer->GetGUID()); -// assert(false); +// ASSERT(false); return; } @@ -15464,8 +15464,8 @@ void Unit::RemoveCharmedBy(Unit *charmer) if (!charmer) return; - assert(type != CHARM_TYPE_POSSESS || charmer->GetTypeId() == TYPEID_PLAYER); - assert(type != CHARM_TYPE_VEHICLE || GetTypeId() == TYPEID_UNIT && IsVehicle()); + ASSERT(type != CHARM_TYPE_POSSESS || charmer->GetTypeId() == TYPEID_PLAYER); + ASSERT(type != CHARM_TYPE_VEHICLE || GetTypeId() == TYPEID_UNIT && IsVehicle()); charmer->SetCharm(this, false); @@ -16273,7 +16273,7 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId) bg->EventPlayerDroppedFlag(this->ToPlayer()); } - assert(!m_vehicle); + ASSERT(!m_vehicle); m_vehicle = vehicle; if (!m_vehicle->AddPassenger(this, seatId)) { @@ -16309,7 +16309,7 @@ void Unit::ChangeSeat(int8 seatId, bool next) m_vehicle->RemovePassenger(this); if (!m_vehicle->AddPassenger(this, seatId)) - assert(false); + ASSERT(false); } void Unit::ExitVehicle() diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 5be9415a023..6ab3bf38101 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1913,7 +1913,7 @@ class Unit : public WorldObject ++m_procDeep; else { - assert(m_procDeep); + ASSERT(m_procDeep); --m_procDeep; } } diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index ea863245d42..038c3aa302f 100644 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -61,13 +61,13 @@ Vehicle::Vehicle(Unit *unit, VehicleEntry const *vehInfo) : me(unit), m_vehicleI default: break; } - assert(!m_Seats.empty()); + ASSERT(!m_Seats.empty()); } Vehicle::~Vehicle() { for (SeatMap::const_iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr) - assert(!itr->second.passenger); + ASSERT(!itr->second.passenger); } void Vehicle::Install() @@ -171,7 +171,7 @@ void Vehicle::RemoveAllPassengers() 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()); - //assert(!itr->second.passenger); + //ASSERT(!itr->second.passenger); itr->second.passenger = NULL; } } @@ -222,7 +222,7 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion) // already installed 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) passenger->ToCreature()->AI()->EnterEvadeMode(); return; @@ -265,7 +265,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId) if (seat->second.passenger) 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); @@ -273,7 +273,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId) seat->second.passenger = unit; if (seat->second.seatInfo->IsUsable()) { - assert(m_usableSeatNum); + ASSERT(m_usableSeatNum); --m_usableSeatNum; if (!m_usableSeatNum) { @@ -302,7 +302,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId) && unit->GetTypeId() == TYPEID_PLAYER && seat->first == 0 && seat->second.seatInfo->m_flags & 0x800) // not right if (!me->SetCharmedBy(unit, CHARM_TYPE_VEHICLE)) - assert(false); + ASSERT(false); if (me->IsInWorld()) { @@ -335,7 +335,7 @@ void Vehicle::RemovePassenger(Unit *unit) if (seat->second.passenger == unit) 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); @@ -372,7 +372,7 @@ void Vehicle::RemovePassenger(Unit *unit) void Vehicle::RelocatePassengers(float x, float y, float z, float ang) { 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 for (SeatMap::const_iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr) diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index 6a6a9b07a89..20b20ca4e70 100644 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -197,14 +197,14 @@ Corpse* ObjectAccessor::GetCorpseForPlayerGUID(uint64 guid) if (iter == i_player2corpse.end()) return NULL; - assert(iter->second->GetType() != CORPSE_BONES); + ASSERT(iter->second->GetType() != CORPSE_BONES); return iter->second; } void ObjectAccessor::RemoveCorpse(Corpse* corpse) { - assert(corpse && corpse->GetType() != CORPSE_BONES); + ASSERT(corpse && corpse->GetType() != CORPSE_BONES); if (corpse->FindMap()) corpse->FindMap()->Remove(corpse, false); @@ -231,13 +231,13 @@ void ObjectAccessor::RemoveCorpse(Corpse* corpse) void ObjectAccessor::AddCorpse(Corpse* corpse) { - assert(corpse && corpse->GetType() != CORPSE_BONES); + ASSERT(corpse && corpse->GetType() != CORPSE_BONES); // Critical section { 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; // build mapid*cellid -> guid_set map @@ -354,7 +354,7 @@ void ObjectAccessor::Update(uint32 /*diff*/) while (!i_objects.empty()) { Object* obj = *i_objects.begin(); - assert(obj && obj->IsInWorld()); + ASSERT(obj && obj->IsInWorld()); i_objects.erase(i_objects.begin()); obj->BuildUpdate(update_players); } diff --git a/src/server/game/Globals/ObjectAccessor.h b/src/server/game/Globals/ObjectAccessor.h index d35f5cd155b..8134bff2c19 100644 --- a/src/server/game/Globals/ObjectAccessor.h +++ b/src/server/game/Globals/ObjectAccessor.h @@ -127,7 +127,7 @@ class ObjectAccessor // returns object if is in map template<class T> static T* GetObjectInMap(uint64 guid, Map * map, T* /*typeSpecifier*/) { - assert(map); + ASSERT(map); if (T * obj = GetObjectInWorld(guid, (T*)NULL)) if (obj->GetMap() == map) return obj; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 96e73e56566..ff1937defa7 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -8994,7 +8994,7 @@ void ObjectMgr::RemoveGMTicket(GM_Ticket *ticket, int64 source, bool permanently void ObjectMgr::RemoveGMTicket(uint64 ticketGuid, int64 source, bool permanently) { GM_Ticket *ticket = GetGMTicket(ticketGuid); - assert(ticket); + ASSERT(ticket); RemoveGMTicket(ticket, source, permanently); } diff --git a/src/server/game/Grids/Cells/CellImpl.h b/src/server/game/Grids/Cells/CellImpl.h index d906e81a5c9..29f76c43173 100644 --- a/src/server/game/Grids/Cells/CellImpl.h +++ b/src/server/game/Grids/Cells/CellImpl.h @@ -112,7 +112,7 @@ Cell::Visit(const CellPair& standing_cell, TypeContainerVisitor<T, CONTAINER> &v } default: { - assert(false); + ASSERT(false); break; } } diff --git a/src/server/game/Grids/Grid.h b/src/server/game/Grids/Grid.h index 2e300ac5e38..d7cd150f91a 100644 --- a/src/server/game/Grids/Grid.h +++ b/src/server/game/Grids/Grid.h @@ -61,7 +61,7 @@ class Grid template<class SPECIFIC_OBJECT> void AddWorldObject(SPECIFIC_OBJECT *obj) { if(!i_objects.template insert<SPECIFIC_OBJECT>(obj)) - assert(false); + ASSERT(false); } /** an object of interested exits the grid @@ -69,7 +69,7 @@ class Grid template<class SPECIFIC_OBJECT> void RemoveWorldObject(SPECIFIC_OBJECT *obj) { if(!i_objects.template remove<SPECIFIC_OBJECT>(obj)) - assert(false); + ASSERT(false); } /** Refreshes/update the grid. This required for remote grids. @@ -107,7 +107,7 @@ class Grid template<class SPECIFIC_OBJECT> void AddGridObject(SPECIFIC_OBJECT *obj) { if(!i_container.template insert<SPECIFIC_OBJECT>(obj)) - assert(false); + ASSERT(false); } /** Removes a containter type object from the grid @@ -115,7 +115,7 @@ class Grid template<class SPECIFIC_OBJECT> void RemoveGridObject(SPECIFIC_OBJECT *obj) { if(!i_container.template remove<SPECIFIC_OBJECT>(obj)) - assert(false); + ASSERT(false); } /*bool NoWorldObjectInGrid() const diff --git a/src/server/game/Grids/ObjectGridLoader.cpp b/src/server/game/Grids/ObjectGridLoader.cpp index f0da10975ac..96f9fdd94ca 100644 --- a/src/server/game/Grids/ObjectGridLoader.cpp +++ b/src/server/game/Grids/ObjectGridLoader.cpp @@ -59,7 +59,7 @@ ObjectGridRespawnMover::Visit(CreatureMapType &m) Creature * c = iter->getSource(); ++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(); diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 3f5d422e957..75c3e8202f7 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -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 void Group::SendLooter(Creature *pCreature, Player *pLooter) { - assert(pCreature); + ASSERT(pCreature); WorldPacket data(SMSG_LOOT_LIST, (8+8)); data << uint64(pCreature->GetGUID()); diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 03eec31535e..cb976676527 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -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 { - assert(pSrcItem); + ASSERT(pSrcItem); for (uint32 j = 0; j < GUILD_BANK_MAX_SLOTS; ++j) { // skip specific slot already processed in first called _CanStoreItem_InSpecificSlot diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index b4f56d3f34f..dcc3271e19e 100644 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -154,7 +154,7 @@ InstanceSave::InstanceSave(uint16 MapId, uint32 InstanceId, Difficulty difficult InstanceSave::~InstanceSave() { // 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); if (map) { - assert(map->IsDungeon()); + ASSERT(map->IsDungeon()); if (InstanceData *iData = ((InstanceMap*)map)->GetInstanceData()) { data = iData->GetSaveData(); @@ -222,7 +222,7 @@ bool InstanceSave::UnloadIfEmpty() void InstanceSaveManager::_DelHelper(DatabaseType &db, const char *fields, const char *table, const char *queryTail,...) { Tokens fieldTokens = StrSplit(fields, ", "); - assert(fieldTokens.size() != 0); + ASSERT(fieldTokens.size() != 0); va_list ap; char szQueryTail [MAX_QUERY_LEN]; diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index c02ef5856fe..6fd0415d673 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -67,8 +67,8 @@ Map::~Map() while (!i_worldObjects.empty()) { WorldObject *obj = *i_worldObjects.begin(); - assert(obj->m_isWorldObject); - //assert(obj->GetTypeId() == TYPEID_CORPSE); + ASSERT(obj->m_isWorldObject); + //ASSERT(obj->GetTypeId() == TYPEID_CORPSE); obj->RemoveFromWorld(); 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); NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY()); - assert(ngrid != NULL); + ASSERT(ngrid != NULL); 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()) || !grid.AddWorldObject<T>(obj, obj->GetGUID())) { - assert(false); + ASSERT(false); }*/ } else @@ -305,7 +305,7 @@ void Map::SwitchGridContainers(T* obj, bool on) /*if (!grid.RemoveWorldObject<T>(obj, obj->GetGUID()) || !grid.AddGridObject<T>(obj, obj->GetGUID())) { - assert(false); + ASSERT(false); }*/ } obj->m_isWorldObject = on; @@ -361,7 +361,7 @@ Map::EnsureGridLoadedAtEnter(const Cell &cell, Player *player) { EnsureGridLoaded(cell); NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); - assert(grid != NULL); + ASSERT(grid != NULL); if (player) { @@ -385,7 +385,7 @@ bool Map::EnsureGridLoaded(const Cell &cell) EnsureGridCreated(GridPair(cell.GridX(), cell.GridY())); NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); - assert(grid != NULL); + ASSERT(grid != NULL); if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY())) { 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) { // Check if we are adding to correct map - assert (player->GetMap() == this); + ASSERT (player->GetMap() == this); 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) { @@ -426,7 +426,7 @@ bool Map::Add(Player *player) Cell cell(p); EnsureGridLoadedAtEnter(cell, player); NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); - assert(grid != NULL); + ASSERT(grid != NULL); AddToGrid(player, grid, cell); player->AddToWorld(); @@ -464,7 +464,7 @@ Map::Add(T *obj) EnsureGridCreated(GridPair(cell.GridX(), cell.GridY())); NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); - assert(grid != NULL); + ASSERT(grid != NULL); AddToGrid(obj,grid,cell); //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()); NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); - assert(grid != NULL); + ASSERT(grid != NULL); player->UpdateObjectVisibility(true); 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); NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); - assert(grid != NULL); + ASSERT(grid != NULL); obj->UpdateObjectVisibility(true); RemoveFromGrid(obj,grid,cell); @@ -875,7 +875,7 @@ Map::Remove(T *obj, bool remove) void 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 new_val = Trinity::ComputeCellPair(x, y); @@ -905,7 +905,7 @@ Map::PlayerRelocation(Player *player, float x, float y, float z, float orientati void 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(); @@ -928,7 +928,7 @@ Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang creature->UpdateObjectVisibility(false); } - assert(CheckGridIntegrity(creature,true)); + ASSERT(CheckGridIntegrity(creature,true)); } 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) { NGridType *grid = getNGrid(x, y); - assert(grid != NULL); + ASSERT(grid != NULL); { if (!unloadAll && ActiveObjectsNearGrid(x, y)) @@ -1106,7 +1106,7 @@ bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll) unloader.UnloadN(); - assert(i_objectsToRemove.empty()); + ASSERT(i_objectsToRemove.empty()); delete grid; 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) { sLog.outError("map::setNGrid() Invalid grid coordinates found: %d, %d!",x,y); - assert(false); + ASSERT(false); } i_grids[x][y] = grid; } @@ -2138,7 +2138,7 @@ void Map::DelayedUpdate(const uint32 t_diff) NGridType *grid = i->getSource(); GridInfo *info = i->getSource()->getGridInfoRef(); ++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); } } @@ -2146,7 +2146,7 @@ void Map::DelayedUpdate(const uint32 t_diff) 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 @@ -2156,7 +2156,7 @@ void Map::AddObjectToRemoveList(WorldObject *obj) 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); if (itr == i_objectsToSwitch.end()) @@ -2164,7 +2164,7 @@ void Map::AddObjectToSwitchList(WorldObject *obj, bool on) else if (itr->second != on) i_objectsToSwitch.erase(itr); else - assert(false); + ASSERT(false); } void Map::RemoveAllObjectsInRemoveList() @@ -2368,7 +2368,7 @@ bool InstanceMap::CanEnter(Player *player) 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()); - assert(false); + ASSERT(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()); 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; } // bind to the group or keep using the group save @@ -2511,7 +2511,7 @@ bool InstanceMap::Add(Player *player) player->BindToInstance(mapSave, false); else // 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() { - assert(!HavePlayers()); + ASSERT(!HavePlayers()); if (m_resetAfterUnload == true) objmgr.DeleteRespawnTimeForInstance(GetInstanceId()); @@ -2708,7 +2708,7 @@ uint32 InstanceMap::GetMaxPlayers() const return normalDiff ? normalDiff->maxPlayers : 0; } } - else // I'd rather assert(false); + else // I'd rather ASSERT(false); return 0; } @@ -2743,7 +2743,7 @@ bool BattleGroundMap::CanEnter(Player * player) if (player->GetMapRef().getTarget() == this) { sLog.outError("BGMap::CanEnter - player %u is already in map!", player->GetGUIDLow()); - assert(false); + ASSERT(false); return false; } diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 3a7375f52f4..9306dba4112 100644 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -190,13 +190,13 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave *save, if (!entry) { sLog.outError("CreateInstance: no entry for map %d", GetId()); - assert(false); + ASSERT(false); } const InstanceTemplate * iTemplate = objmgr.GetInstanceTemplate(GetId()); if (!iTemplate) { sLog.outError("CreateInstance: no instance template for map %d", GetId()); - assert(false); + ASSERT(false); } // some instances only have one difficulty @@ -261,6 +261,6 @@ bool MapInstanced::DestroyInstance(InstancedMaps::iterator &itr) bool MapInstanced::CanEnter(Player * /*player*/) { - //assert(false); + //ASSERT(false); return true; } diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 2278e73e626..bb95516dfca 100644 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -125,7 +125,7 @@ Map* MapManager::_createBaseMap(uint32 id) i_maps[id] = m; } - assert(m != NULL); + ASSERT(m != NULL); return m; } diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 46a4c806067..d47ee113ca4 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -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? return; - assert(!empty()); + ASSERT(!empty()); m_cleanFlag |= MMCF_UPDATE; if (!top()->Update(*i_owner, diff)) { diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index 73e24486768..caddbbf4b1f 100644 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -154,7 +154,7 @@ ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff) if (i_nextMoveTime.Passed()) { // start moving - assert(i_nextMove <= MAX_CONF_WAYPOINTS); + ASSERT(i_nextMove <= MAX_CONF_WAYPOINTS); const float x = i_waypoints[i_nextMove][0]; const float y = i_waypoints[i_nextMove][1]; const float z = i_waypoints[i_nextMove][2]; diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 416b775ef7e..62f746bce59 100644 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -161,7 +161,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff) { if (StopedByPlayer) { - assert(node); + ASSERT(node); InitTraveller(unit, *node); i_destinationHolder.SetDestination(traveller, node->x, node->y, node->z); i_nextMoveTime.Reset(i_destinationHolder.GetTotalTravelTime()); diff --git a/src/server/game/Movement/Traveller.h b/src/server/game/Movement/Traveller.h index c581f7017b5..e3882b350da 100644 --- a/src/server/game/Movement/Traveller.h +++ b/src/server/game/Movement/Traveller.h @@ -50,7 +50,7 @@ struct Traveller float GetPositionZ() const { return i_traveller.GetPositionZ(); } 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); uint32 GetTotalTrevelTimeTo(float x, float y, float z); diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index a31361e9275..50b687e1595 100644 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -67,7 +67,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() GetPlayer()->SetSemaphoreTeleportFar(false); Map * oldMap = GetPlayer()->GetMap(); - assert(oldMap); + ASSERT(oldMap); if (GetPlayer()->IsInWorld()) { 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; - 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; diff --git a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp index bc7428ddf13..1cfcabe21e7 100644 --- a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp @@ -212,7 +212,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid _player->StopCastingCharm(); else if (pet->GetOwnerGUID() == GetPlayer()->GetGUID()) { - assert(pet->GetTypeId() == TYPEID_UNIT); + ASSERT(pet->GetTypeId() == TYPEID_UNIT); if (pet->isPet()) { if (((Pet*)pet)->getPetType() == HUNTER_PET) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 46b4fa0a0b1..2151d9cc86e 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -878,7 +878,7 @@ void AuraEffect::CalculateSpellMod() { m_spellmod = new SpellModifier(GetBase()); 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->spellId = GetId(); @@ -917,7 +917,7 @@ void AuraEffect::ChangeAmount(int32 newAmount, bool mark) void AuraEffect::HandleEffect(AuraApplication const * aurApp, uint8 mode, bool apply) { // check if call is correct - assert(!mode + ASSERT(!mode || mode == AURA_EFFECT_HANDLE_REAL || mode == AURA_EFFECT_HANDLE_SEND_FOR_CLIENT || 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) { AuraApplication const * aurApp = GetBase()->GetApplicationOfTarget(target->GetGUID()); - assert(aurApp); + ASSERT(aurApp); HandleEffect(aurApp, mode, apply); } @@ -1169,7 +1169,7 @@ void AuraEffect::UpdatePeriodic(Unit * caster) bool AuraEffect::IsPeriodicTickCrit(Unit * target, Unit const * caster) const { - assert(caster); + ASSERT(caster); Unit::AuraEffectList const& mPeriodicCritAuras= caster->GetAuraEffectsByType(SPELL_AURA_ABILITY_PERIODIC_CRIT); for (Unit::AuraEffectList::const_iterator itr = mPeriodicCritAuras.begin(); itr != mPeriodicCritAuras.end(); ++itr) { diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 6b59bec78cc..44ba34bf981 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -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_removeMode(AURA_REMOVE_NONE), m_effectsToApply(effMask) { - assert(GetTarget() && GetBase()); + ASSERT(GetTarget() && GetBase()); if (GetBase()->IsVisible()) { @@ -137,9 +137,9 @@ bool AuraApplication::_CheckPositive(Unit * /*caster*/) const void AuraApplication::_HandleEffect(uint8 effIndex, bool apply) { AuraEffect * aurEff = GetBase()->GetEffect(effIndex); - assert(aurEff); - assert(HasEffect(effIndex) == (!apply)); - assert((1<<effIndex) & m_effectsToApply); + ASSERT(aurEff); + ASSERT(HasEffect(effIndex) == (!apply)); + ASSERT((1<<effIndex) & m_effectsToApply); sLog.outDebug("AuraApplication::_HandleEffect: %u, apply: %u: amount: %u", aurEff->GetAuraType(), apply, aurEff->GetAmount()); Unit * caster = GetBase()->GetCaster(); @@ -177,13 +177,13 @@ void AuraApplication::ClientUpdate(bool remove) if (remove) { - assert(!m_target->GetVisibleAura(m_slot)); + ASSERT(!m_target->GetVisibleAura(m_slot)); data << uint32(0); sLog.outDebug("Aura %u removed slot %u",GetBase()->GetId(), m_slot); m_target->SendMessageToSet(&data, true); return; } - assert(m_target->GetVisibleAura(m_slot)); + ASSERT(m_target->GetVisibleAura(m_slot)); Aura const * aura = GetBase(); 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) { - assert(spellproto); - assert(owner); - assert(caster || casterGUID); - assert(tryEffMask <= MAX_EFFECT_MASK); + ASSERT(spellproto); + ASSERT(owner); + ASSERT(caster || casterGUID); + ASSERT(tryEffMask <= MAX_EFFECT_MASK); uint8 effMask = 0; 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) { - assert(spellproto); - assert(owner); - assert(caster || casterGUID); + ASSERT(spellproto); + ASSERT(owner); + ASSERT(caster || casterGUID); uint8 effMask = 0; 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) { - assert(effMask); - assert(spellproto); - assert(owner); - assert(caster || casterGUID); - assert(effMask <= MAX_EFFECT_MASK); + ASSERT(effMask); + ASSERT(spellproto); + ASSERT(owner); + ASSERT(caster || casterGUID); + ASSERT(effMask <= MAX_EFFECT_MASK); // try to get caster of aura 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); break; default: - assert(false); + ASSERT(false); return NULL; } // aura can be removed in Unit::_AddAura call @@ -345,7 +345,7 @@ Aura::~Aura() for (uint8 i = 0 ; i < MAX_SPELL_EFFECTS; ++i) delete m_effects[i]; - assert(m_applications.empty()); + ASSERT(m_applications.empty()); _DeleteRemovedApplications(); } @@ -366,10 +366,10 @@ AuraObjectType Aura::GetType() const void Aura::_ApplyForTarget(Unit * target, Unit * caster, AuraApplication * auraApp) { - assert(target); - assert(auraApp); + ASSERT(target); + ASSERT(auraApp); // 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; @@ -386,9 +386,9 @@ void Aura::_ApplyForTarget(Unit * target, Unit * caster, AuraApplication * auraA void Aura::_UnapplyForTarget(Unit * target, Unit * caster, AuraApplication * auraApp) { - assert(target); - assert(auraApp->GetRemoveMode()); - assert(auraApp); + ASSERT(target); + ASSERT(auraApp->GetRemoveMode()); + ASSERT(auraApp); ApplicationMap::iterator itr = m_applications.find(target->GetGUID()); // TODO: Figure out why this happens. @@ -401,7 +401,7 @@ void Aura::_UnapplyForTarget(Unit * target, Unit * caster, AuraApplication * aur m_applications.erase(itr); // aura has to be already applied - //assert(itr->second == auraApp); + //ASSERT(itr->second == auraApp); m_removedApplications.push_back(auraApp); // reset cooldown state for spells @@ -417,7 +417,7 @@ void Aura::_UnapplyForTarget(Unit * target, Unit * caster, AuraApplication * aur // and marks aura as removed void Aura::_Remove(AuraRemoveMode removeMode) { - assert (!m_isRemoved); + ASSERT (!m_isRemoved); m_isRemoved = true; ApplicationMap::iterator appItr = m_applications.begin(); for (appItr = m_applications.begin(); appItr != m_applications.end();) @@ -506,7 +506,7 @@ void Aura::UpdateTargetMap(Unit * caster, bool apply) else { // 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; } @@ -528,7 +528,7 @@ void Aura::UpdateTargetMap(Unit * caster, bool apply) if (AuraApplication * aurApp = GetApplicationOfTarget(itr->first->GetGUID())) { // 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); } } @@ -552,14 +552,14 @@ void Aura::_ApplyEffectForTargets(uint8 effIndex) if (GetApplicationOfTarget((*itr)->GetGUID())) { // 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); } } } void Aura::UpdateOwner(uint32 diff, WorldObject * owner) { - assert(owner == m_owner); + ASSERT(owner == m_owner); Unit * caster = GetCaster(); // Apply spellmods for channeled auras @@ -759,7 +759,7 @@ bool Aura::IsVisible() const void Aura::UnregisterSingleTarget() { - assert(m_isSingleTarget); + ASSERT(m_isSingleTarget); Unit * caster = GetCaster(); caster->GetSingleCastAuras().remove(this); SetIsSingleTarget(false); @@ -795,7 +795,7 @@ bool Aura::HasEffectType(AuraType type) const void Aura::RecalculateAmountOfEffects() { - assert (!IsRemoved()); + ASSERT (!IsRemoved()); Unit * caster = GetCaster(); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (m_effects[i]) @@ -804,7 +804,7 @@ void Aura::RecalculateAmountOfEffects() void Aura::HandleAllEffects(AuraApplication const * aurApp, uint8 mode, bool apply) { - assert (!IsRemoved()); + ASSERT (!IsRemoved()); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (m_effects[i] && !IsRemoved()) m_effects[i]->HandleEffect(aurApp, mode, apply); @@ -1492,7 +1492,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, bool Aura::CheckAreaTarget(Unit *target) { // for owner check use Spell::CheckTarget - assert(GetOwner() != target); + ASSERT(GetOwner() != target); // some special cases switch(GetId()) diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 97c0076fcd5..c598f1b6cdf 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -65,7 +65,7 @@ class AuraApplication uint8 GetSlot() const { return m_slot; } uint8 GetFlags() const { return m_flags; } 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; } uint8 GetEffectsToApply() const { return m_effectsToApply; } @@ -95,8 +95,8 @@ class Aura uint64 const& GetCasterGUID() const { return m_casterGuid; } Unit* GetCaster() const; WorldObject * GetOwner() const { return 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; } + Unit * GetUnitOwner() const { ASSERT(GetType() == UNIT_AURA_TYPE); return (Unit*)m_owner; } + DynamicObject * GetDynobjOwner() const { ASSERT(GetType() == DYNOBJ_AURA_TYPE); return (DynamicObject*)m_owner; } AuraObjectType GetType() const; @@ -150,7 +150,7 @@ class Aura // helpers for aura effects bool HasEffect(uint8 effIndex) const { return bool(GetEffect(effIndex)); } 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; } void RecalculateAmountOfEffects(); void HandleAllEffects(AuraApplication const * aurApp, uint8 mode, bool apply); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index e538d93a29e..c24efa2b9ab 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -467,13 +467,13 @@ Spell::~Spell() if (m_referencedFromCurrentSpell && m_selfContainer && *m_selfContainer == this) { // 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); *m_selfContainer = NULL; } 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; } @@ -1402,7 +1402,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool if (scaleAura) { aurSpellInfo = spellmgr.SelectAuraRankForPlayerLevel(m_spellInfo,unitTarget->getLevel()); - assert (aurSpellInfo); + ASSERT (aurSpellInfo); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { basePoints[i] = aurSpellInfo->EffectBasePoints[i]; diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 777f338a962..e9e6fe626a2 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -716,7 +716,7 @@ namespace Trinity : i_source(source), i_data(&data), i_radius(radius), i_push_type(type) , i_TargetType(TargetType), i_pos(pos), i_entry(entry) { - assert(i_source); + ASSERT(i_source); } template<class T> inline void Visit(GridRefManager<T> &m) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index e5776e33a49..a4cbdc1a81a 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2540,7 +2540,7 @@ void Spell::EffectApplyAura(uint32 i) { if (!m_spellAura || !unitTarget) return; - assert(unitTarget == m_spellAura->GetOwner()); + ASSERT(unitTarget == m_spellAura->GetOwner()); m_spellAura->_ApplyEffectForTargets(i); } @@ -2548,7 +2548,7 @@ void Spell::EffectApplyAreaAura(uint32 i) { if (!m_spellAura || !unitTarget) return; - assert (unitTarget == m_spellAura->GetOwner()); + ASSERT (unitTarget == m_spellAura->GetOwner()); m_spellAura->_ApplyEffectForTargets(i); } @@ -3067,12 +3067,12 @@ void Spell::EffectPersistentAA(uint32 i) m_spellAura = aura; else { - assert(false); + ASSERT(false); return; } m_spellAura->_RegisterForTargets(); } - assert(m_spellAura->GetDynobjOwner()); + ASSERT(m_spellAura->GetDynobjOwner()); m_spellAura->_ApplyEffectForTargets(i); } @@ -4265,7 +4265,7 @@ void Spell::EffectSummonPet(uint32 i) if (OldSummon->isDead()) return; - assert(OldSummon->GetMap() == owner->GetMap()); + ASSERT(OldSummon->GetMap() == owner->GetMap()); //OldSummon->GetMap()->Remove(OldSummon->ToCreature(),false); diff --git a/src/server/shared/Debugging/Errors.h b/src/server/shared/Debugging/Errors.h index 15c6b1414ed..849ed17c0eb 100644 --- a/src/server/shared/Debugging/Errors.h +++ b/src/server/shared/Debugging/Errors.h @@ -34,9 +34,9 @@ #endif #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 -#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 #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 ); } |