[10432] Rename ASSERT -> MANGOS_ASSERT and related fixes

ASSERT hard use in predictable way because diff. 3rd party libs code
redefine it inf different ways and hard make sure that used in end
of mangos define version. This is real detected problem make some
expected assert checks ignored and so bugs not detected as expected from code.

In addition made related changes:
* Common.h header expected to be first include in any src/game/header except most simple cases.
* Related FILE.h header expected to be first include in FILE.cpp
* Fixed some absent includes and type forwards for safe build without PCH enabled.
* Avoid using MANGOS_ASSERT in src/framework code
This commit is contained in:
VladimirMangos 2010-09-02 04:18:55 +04:00
parent 32e3e252fb
commit acd0716297
77 changed files with 309 additions and 260 deletions

View file

@ -26,6 +26,8 @@
#include "GameSystem/GridReference.h"
#include "Timer.h"
#include <cassert>
class GridInfo
{
public:
@ -96,15 +98,15 @@ class MANGOS_DLL_DECL NGrid
const GridType& operator()(uint32 x, uint32 y) const
{
ASSERT(x < N);
ASSERT(y < N);
assert(x < N);
assert(y < N);
return i_cells[x][y];
}
GridType& operator()(uint32 x, uint32 y)
{
ASSERT(x < N);
ASSERT(y < N);
assert(x < N);
assert(y < N);
return i_cells[x][y];
}
@ -185,8 +187,8 @@ class MANGOS_DLL_DECL NGrid
GridType& getGridType(const uint32& x, const uint32& y)
{
ASSERT(x < N);
ASSERT(y < N);
assert(x < N);
assert(y < N);
return i_cells[x][y];
}

View file

@ -24,6 +24,7 @@
* types of object at the same time.
*/
#include <cassert>
#include <map>
#include <vector>
#include "Platform/Define.h"
@ -89,7 +90,7 @@ class TypeUnorderedMapContainer
}
else
{
ASSERT(i->second == obj && "Object with certain key already in but objects are different!");
assert(i->second == obj && "Object with certain key already in but objects are different!");
return false;
}
}

View file

@ -54,7 +54,7 @@ class Reference : public LinkedListElement
// Create new link
void link(TO* toObj, FROM* fromObj)
{
ASSERT(fromObj); // fromObj MUST not be NULL
assert(fromObj); // fromObj MUST not be NULL
if (isValid())
unlink();

View file

@ -2164,7 +2164,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
if(!criteria)
continue;
ASSERT(criteria->requiredType < ACHIEVEMENT_CRITERIA_TYPE_TOTAL && "Not updated ACHIEVEMENT_CRITERIA_TYPE_TOTAL?");
MANGOS_ASSERT(criteria->requiredType < ACHIEVEMENT_CRITERIA_TYPE_TOTAL && "Not updated ACHIEVEMENT_CRITERIA_TYPE_TOTAL?");
m_AchievementCriteriasByType[criteria->requiredType].push_back(criteria);
m_AchievementCriteriaListByAchievement[criteria->referredAchievement].push_back(criteria);

View file

@ -16,14 +16,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Common.h"
#include "AuctionHouseMgr.h"
#include "Database/DatabaseEnv.h"
#include "Database/SQLStorage.h"
#include "DBCStores.h"
#include "ProgressBar.h"
#include "AccountMgr.h"
#include "AuctionHouseMgr.h"
#include "Item.h"
#include "Language.h"
#include "Log.h"
@ -439,8 +438,8 @@ void AuctionHouseMgr::LoadAuctions()
void AuctionHouseMgr::AddAItem( Item* it )
{
ASSERT( it );
ASSERT( mAitems.find(it->GetGUIDLow()) == mAitems.end());
MANGOS_ASSERT( it );
MANGOS_ASSERT( mAitems.find(it->GetGUIDLow()) == mAitems.end());
mAitems[it->GetGUIDLow()] = it;
}

View file

@ -19,8 +19,10 @@
#ifndef _AUCTION_HOUSE_MGR_H
#define _AUCTION_HOUSE_MGR_H
#include "Common.h"
#include "SharedDefines.h"
#include "Policies/Singleton.h"
#include "DBCStructure.h"
class Item;
class Player;
@ -86,7 +88,7 @@ class AuctionHouseObject
void AddAuction(AuctionEntry *ah)
{
ASSERT( ah );
MANGOS_ASSERT( ah );
AuctionsMap[ah->Id] = ah;
}

View file

@ -16,7 +16,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Common.h"
#include "Bag.h"
#include "ObjectMgr.h"
#include "Database/DatabaseEnv.h"
@ -136,7 +135,7 @@ uint32 Bag::GetFreeSlots() const
void Bag::RemoveItem( uint8 slot, bool /*update*/ )
{
ASSERT(slot < MAX_BAG_SIZE);
MANGOS_ASSERT(slot < MAX_BAG_SIZE);
if (m_bagslot[slot])
m_bagslot[slot]->SetContainer(NULL);
@ -147,7 +146,7 @@ void Bag::RemoveItem( uint8 slot, bool /*update*/ )
void Bag::StoreItem( uint8 slot, Item *pItem, bool /*update*/ )
{
ASSERT(slot < MAX_BAG_SIZE);
MANGOS_ASSERT(slot < MAX_BAG_SIZE);
if( pItem )
{

View file

@ -19,12 +19,13 @@
#ifndef MANGOS_BAG_H
#define MANGOS_BAG_H
// Maximum 36 Slots ( (CONTAINER_END - CONTAINER_FIELD_SLOT_1)/2
#define MAX_BAG_SIZE 36 // 2.0.12
#include "Common.h"
#include "ItemPrototype.h"
#include "Item.h"
// Maximum 36 Slots ( (CONTAINER_END - CONTAINER_FIELD_SLOT_1)/2
#define MAX_BAG_SIZE 36 // 2.0.12
class Bag : public Item
{
public:

View file

@ -393,7 +393,7 @@ class BattleGround
void SetBgMap(BattleGroundMap* map) { m_Map = map; }
BattleGroundMap* GetBgMap()
{
ASSERT(m_Map);
MANGOS_ASSERT(m_Map);
return m_Map;
}

View file

@ -252,7 +252,7 @@ int32 BattleGroundAB::_GetNodeNameId(uint8 node)
case BG_AB_NODE_LUMBER_MILL:return LANG_BG_AB_NODE_LUMBER_MILL;
case BG_AB_NODE_GOLD_MINE: return LANG_BG_AB_NODE_GOLD_MINE;
default:
ASSERT(0);
MANGOS_ASSERT(0);
}
return 0;
}

View file

@ -18,7 +18,8 @@
#ifndef __BATTLEGROUNDAB_H
#define __BATTLEGROUNDAB_H
class BattleGround;
#include "Common.h"
#include "BattleGround.h"
enum BG_AB_WorldStates
{

View file

@ -210,7 +210,7 @@ void BattleGroundAV::HandleQuestComplete(uint32 questid, Player *player)
void BattleGroundAV::UpdateScore(BattleGroundTeamId team, int32 points )
{
// note: to remove reinforcements points must be negative, for adding reinforcements points must be positive
ASSERT( team == BG_TEAM_ALLIANCE || team == BG_TEAM_HORDE);
MANGOS_ASSERT( team == BG_TEAM_ALLIANCE || team == BG_TEAM_HORDE);
m_TeamScores[team] += points; // m_TeamScores is int32 - so no problems here
if (points < 0)
@ -449,7 +449,7 @@ void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team)
// TODO implement quest 7122
// mine=0 northmine, mine=1 southmine
// TODO changing the owner should result in setting respawntime to infinite for current creatures (they should fight the new ones), spawning new mine owners creatures and changing the chest - objects so that the current owning team can use them
ASSERT(mine == BG_AV_NORTH_MINE || mine == BG_AV_SOUTH_MINE);
MANGOS_ASSERT(mine == BG_AV_NORTH_MINE || mine == BG_AV_SOUTH_MINE);
if (m_Mine_Owner[mine] == int8(team))
return;
@ -533,7 +533,7 @@ void BattleGroundAV::EventPlayerClickedOnFlag(Player *source, GameObject* target
void BattleGroundAV::EventPlayerDefendsPoint(Player* player, BG_AV_Nodes node)
{
ASSERT(GetStatus() == STATUS_IN_PROGRESS);
MANGOS_ASSERT(GetStatus() == STATUS_IN_PROGRESS);
uint32 team = GetTeamIndexByTeamId(player->GetTeam());
@ -543,7 +543,7 @@ void BattleGroundAV::EventPlayerDefendsPoint(Player* player, BG_AV_Nodes node)
{
// until snowfall doesn't belong to anyone it is better handled in assault - code (best would be to have a special function
// for neutral nodes.. but doing this just for snowfall will be a bit to much i think
ASSERT(node == BG_AV_NODES_SNOWFALL_GRAVE); // currently the only neutral grave
MANGOS_ASSERT(node == BG_AV_NODES_SNOWFALL_GRAVE); // currently the only neutral grave
EventPlayerAssaultsPoint(player, node);
return;
}
@ -659,9 +659,9 @@ void BattleGroundAV::UpdateNodeWorldState(BG_AV_Nodes node)
void BattleGroundAV::SendMineWorldStates(uint32 mine)
{
ASSERT(mine == BG_AV_NORTH_MINE || mine == BG_AV_SOUTH_MINE);
ASSERT(m_Mine_PrevOwner[mine] == BG_TEAM_ALLIANCE || m_Mine_PrevOwner[mine] == BG_TEAM_HORDE || m_Mine_PrevOwner[mine] == BG_AV_NEUTRAL_TEAM);
ASSERT(m_Mine_Owner[mine] == BG_TEAM_ALLIANCE || m_Mine_Owner[mine] == BG_TEAM_HORDE || m_Mine_Owner[mine] == BG_AV_NEUTRAL_TEAM);
MANGOS_ASSERT(mine == BG_AV_NORTH_MINE || mine == BG_AV_SOUTH_MINE);
MANGOS_ASSERT(m_Mine_PrevOwner[mine] == BG_TEAM_ALLIANCE || m_Mine_PrevOwner[mine] == BG_TEAM_HORDE || m_Mine_PrevOwner[mine] == BG_AV_NEUTRAL_TEAM);
MANGOS_ASSERT(m_Mine_Owner[mine] == BG_TEAM_ALLIANCE || m_Mine_Owner[mine] == BG_TEAM_HORDE || m_Mine_Owner[mine] == BG_AV_NEUTRAL_TEAM);
UpdateWorldState(BG_AV_MineWorldStates[mine][m_Mine_Owner[mine]], 1);
if (m_Mine_Owner[mine] != m_Mine_PrevOwner[mine])
@ -725,11 +725,11 @@ uint32 BattleGroundAV::GetNodeName(BG_AV_Nodes node)
void BattleGroundAV::AssaultNode(BG_AV_Nodes node, uint32 team)
{
ASSERT(team < 3); // alliance:0, horde:1, neutral:2
ASSERT(m_Nodes[node].TotalOwner != team);
ASSERT(m_Nodes[node].Owner != team);
MANGOS_ASSERT(team < 3); // alliance:0, horde:1, neutral:2
MANGOS_ASSERT(m_Nodes[node].TotalOwner != team);
MANGOS_ASSERT(m_Nodes[node].Owner != team);
// only assault an assaulted node if no totalowner exists:
ASSERT(m_Nodes[node].State != POINT_ASSAULTED || m_Nodes[node].TotalOwner == BG_AV_NEUTRAL_TEAM);
MANGOS_ASSERT(m_Nodes[node].State != POINT_ASSAULTED || m_Nodes[node].TotalOwner == BG_AV_NEUTRAL_TEAM);
// the timer gets another time, if the previous owner was 0 == Neutral
m_Nodes[node].Timer = (m_Nodes[node].PrevOwner != BG_AV_NEUTRAL_TEAM) ? BG_AV_CAPTIME : BG_AV_SNOWFALL_FIRSTCAP;
m_Nodes[node].PrevOwner = m_Nodes[node].Owner;
@ -740,7 +740,7 @@ void BattleGroundAV::AssaultNode(BG_AV_Nodes node, uint32 team)
void BattleGroundAV::DestroyNode(BG_AV_Nodes node)
{
ASSERT(m_Nodes[node].State == POINT_ASSAULTED);
MANGOS_ASSERT(m_Nodes[node].State == POINT_ASSAULTED);
m_Nodes[node].TotalOwner = m_Nodes[node].Owner;
m_Nodes[node].PrevOwner = m_Nodes[node].Owner;
@ -751,7 +751,7 @@ void BattleGroundAV::DestroyNode(BG_AV_Nodes node)
void BattleGroundAV::InitNode(BG_AV_Nodes node, uint32 team, bool tower)
{
ASSERT(team < 3); // alliance:0, horde:1, neutral:2
MANGOS_ASSERT(team < 3); // alliance:0, horde:1, neutral:2
m_Nodes[node].TotalOwner = team;
m_Nodes[node].Owner = team;
m_Nodes[node].PrevOwner = team;
@ -767,10 +767,10 @@ void BattleGroundAV::InitNode(BG_AV_Nodes node, uint32 team, bool tower)
void BattleGroundAV::DefendNode(BG_AV_Nodes node, uint32 team)
{
ASSERT(team < 3); // alliance:0, horde:1, neutral:2
ASSERT(m_Nodes[node].TotalOwner == team);
ASSERT(m_Nodes[node].Owner != team);
ASSERT(m_Nodes[node].State != POINT_CONTROLLED);
MANGOS_ASSERT(team < 3); // alliance:0, horde:1, neutral:2
MANGOS_ASSERT(m_Nodes[node].TotalOwner == team);
MANGOS_ASSERT(m_Nodes[node].Owner != team);
MANGOS_ASSERT(m_Nodes[node].State != POINT_CONTROLLED);
m_Nodes[node].PrevOwner = m_Nodes[node].Owner;
m_Nodes[node].Owner = team;
m_Nodes[node].PrevState = m_Nodes[node].State;

View file

@ -19,7 +19,8 @@
#ifndef __BATTLEGROUNDAV_H
#define __BATTLEGROUNDAV_H
class BattleGround;
#include "Common.h"
#include "BattleGround.h"
#define BG_AV_MAX_NODE_DISTANCE 25 // distance in which players are still counted in range of a banner (for alliance towers this is calculated from the center of the tower)

View file

@ -1,3 +1,21 @@
/*
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Camera.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
@ -13,7 +31,7 @@ Camera::Camera(Player* pl) : m_owner(*pl), m_source(pl)
Camera::~Camera()
{
// view of camera should be already reseted to owner (RemoveFromWorld -> Event_RemovedFromWorld -> ResetView)
ASSERT(m_source == &m_owner);
MANGOS_ASSERT(m_source == &m_owner);
// for symmetry with constructor and way to make viewpoint's list empty
m_source->GetViewPoint().Detach(this);
@ -37,7 +55,7 @@ void Camera::UpdateForCurrentViewPoint()
void Camera::SetView(WorldObject *obj)
{
ASSERT(obj);
MANGOS_ASSERT(obj);
if (m_source == obj)
return;
@ -83,7 +101,7 @@ void Camera::ResetView()
void Camera::Event_AddedToWorld()
{
GridType* grid = m_source->GetViewPoint().m_grid;
ASSERT(grid);
MANGOS_ASSERT(grid);
grid->AddWorldObject(this);
UpdateVisibilityForOwner();

View file

@ -1,7 +1,25 @@
/*
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MANGOSSERVER_CAMERA_H
#define MANGOSSERVER_CAMERA_H
#include "Common.h"
#include "GridDefines.h"
class ViewPoint;

View file

@ -19,6 +19,7 @@
#ifndef MANGOS_CELLIMPL_H
#define MANGOS_CELLIMPL_H
#include "Common.h"
#include "Cell.h"
#include "Map.h"
#include <cmath>
@ -108,7 +109,7 @@ Cell::Visit(const CellPair &standing_cell, TypeContainerVisitor<T, CONTAINER> &v
}
default:
{
ASSERT( false );
MANGOS_ASSERT( false );
break;
}
}

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Common.h"
#include "Chat.h"
#include "Language.h"
#include "Database/DatabaseEnv.h"
#include "WorldPacket.h"
@ -28,7 +28,6 @@
#include "ObjectGuid.h"
#include "Player.h"
#include "UpdateMask.h"
#include "Chat.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
#include "AccountMgr.h"
@ -1255,8 +1254,8 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand *commandTable, const char
bool ChatHandler::ParseCommands(const char* text)
{
ASSERT(text);
ASSERT(*text);
MANGOS_ASSERT(text);
MANGOS_ASSERT(*text);
//if(m_session->GetSecurity() == SEC_PLAYER)
// return false;
@ -1995,7 +1994,7 @@ void ChatHandler::FillMessageData( WorldPacket *data, WorldSession* session, uin
if (type == CHAT_MSG_CHANNEL)
{
ASSERT(channelName);
MANGOS_ASSERT(channelName);
*data << channelName;
}

View file

@ -24,6 +24,7 @@
#include "ObjectGuid.h"
struct AchievementEntry;
struct AchievementCriteriaEntry;
struct AreaTrigger;
struct AreaTriggerEntry;
struct FactionEntry;

View file

@ -16,10 +16,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "ConfusedMovementGenerator.h"
#include "Creature.h"
#include "MapManager.h"
#include "Opcodes.h"
#include "ConfusedMovementGenerator.h"
#include "DestinationHolderImp.h"
template<class T>
@ -140,7 +140,7 @@ bool ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff)
{
// start moving
unit.addUnitState(UNIT_STAT_CONFUSED_MOVE);
ASSERT( i_nextMove <= MAX_CONF_WAYPOINTS );
MANGOS_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];

View file

@ -16,7 +16,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Common.h"
#include "Corpse.h"
#include "Player.h"
#include "UpdateMask.h"
@ -74,7 +73,7 @@ bool Corpse::Create( uint32 guidlow )
bool Corpse::Create( uint32 guidlow, Player *owner)
{
ASSERT(owner);
MANGOS_ASSERT(owner);
WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetPhaseMask());
Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation());
@ -101,7 +100,7 @@ bool Corpse::Create( uint32 guidlow, Player *owner)
void Corpse::SaveToDB()
{
// bones should not be saved to DB (would be deleted on startup anyway)
ASSERT(GetType() != CORPSE_BONES);
MANGOS_ASSERT(GetType() != CORPSE_BONES);
// prevent DB data inconsistence problems and duplicates
CharacterDatabase.BeginTransaction();
@ -126,7 +125,7 @@ void Corpse::SaveToDB()
void Corpse::DeleteBonesFromWorld()
{
ASSERT(GetType() == CORPSE_BONES);
MANGOS_ASSERT(GetType() == CORPSE_BONES);
Corpse* corpse = GetMap()->GetCorpse(GetGUID());
if (!corpse)
@ -141,7 +140,7 @@ void Corpse::DeleteBonesFromWorld()
void Corpse::DeleteFromDB()
{
// bones should not be saved to DB (would be deleted on startup anyway)
ASSERT(GetType() != CORPSE_BONES);
MANGOS_ASSERT(GetType() != CORPSE_BONES);
// all corpses (not bones)
CharacterDatabase.PExecute("DELETE FROM corpse WHERE player = '%d' AND corpse_type <> '0'", GUID_LOPART(GetOwnerGUID()));

View file

@ -19,6 +19,7 @@
#ifndef MANGOSSERVER_CORPSE_H
#define MANGOSSERVER_CORPSE_H
#include "Common.h"
#include "Object.h"
#include "Database/DatabaseEnv.h"
#include "GridDefines.h"

View file

@ -16,14 +16,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Common.h"
#include "Creature.h"
#include "Database/DatabaseEnv.h"
#include "WorldPacket.h"
#include "World.h"
#include "ObjectMgr.h"
#include "ObjectGuid.h"
#include "SpellMgr.h"
#include "Creature.h"
#include "QuestDef.h"
#include "GossipDef.h"
#include "Player.h"
@ -686,7 +685,7 @@ bool Creature::AIM_Initialize()
bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 team, const CreatureData *data)
{
ASSERT(map);
MANGOS_ASSERT(map);
SetMap(map);
SetPhaseMask(phaseMask,false);

View file

@ -16,9 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "CreatureAISelector.h"
#include "Creature.h"
#include "CreatureAIImpl.h"
#include "CreatureAISelector.h"
#include "NullCreatureAI.h"
#include "Policies/SingletonImp.h"
#include "MovementGenerator.h"
@ -69,7 +69,7 @@ namespace FactorySelector
{
const CreatureAICreator *factory = iter->second;
const SelectableAI *p = dynamic_cast<const SelectableAI *>(factory);
ASSERT( p != NULL );
MANGOS_ASSERT( p != NULL );
int val = p->Permit(creature);
if( val > best_val )
{
@ -89,7 +89,7 @@ namespace FactorySelector
MovementGenerator* selectMovementGenerator(Creature *creature)
{
MovementGeneratorRegistry &mv_registry(MovementGeneratorRepository::Instance());
ASSERT( creature->GetCreatureInfo() != NULL );
MANGOS_ASSERT( creature->GetCreatureInfo() != NULL );
MovementGeneratorCreator const * mv_factory = mv_registry.GetRegistryItem(
IS_PLAYER_GUID(creature->GetOwnerGUID()) ? FOLLOW_MOTION_TYPE : creature->GetDefaultMovementType());

View file

@ -281,7 +281,7 @@ template<class T>
inline void LoadDBC(LocalData& localeData,barGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, const std::string& dbc_path, const std::string& filename)
{
// compatibility format and C++ structure sizes
ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename));
MANGOS_ASSERT(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename));
std::string dbc_filename = dbc_path + filename;
if(storage.Load(dbc_filename.c_str()))
@ -463,7 +463,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");
MANGOS_ASSERT(false && "Need update MAX_BATTLEGROUND_BRACKETS by DBC data");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sRandomPropertiesPointsStore, dbcPath,"RandPropPoints.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sScalingStatDistributionStore, dbcPath,"ScalingStatDistribution.dbc");
@ -925,7 +925,7 @@ bool IsPointInAreaTriggerZone(AreaTriggerEntry const* atEntry, uint32 mapid, flo
// rotate the players position instead of rotating the whole cube, that way we can make a simplified
// is-in-cube check and we have to calculate only one point instead of 4
// 2PI = 360°, keep in mind that ingame orientation is counter-clockwise
// 2PI = 360, keep in mind that ingame orientation is counter-clockwise
double rotation = 2*M_PI-atEntry->box_orientation;
double sinVal = sin(rotation);
double cosVal = cos(rotation);

View file

@ -16,9 +16,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Common.h"
#include "QuestDef.h"
#include "GameObject.h"
#include "QuestDef.h"
#include "ObjectMgr.h"
#include "PoolManager.h"
#include "SpellMgr.h"
@ -98,7 +97,7 @@ void GameObject::RemoveFromWorld()
bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state)
{
ASSERT(map);
MANGOS_ASSERT(map);
Relocate(x,y,z,ang);
SetMap(map);
SetPhaseMask(phaseMask,false);

View file

@ -16,8 +16,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "QuestDef.h"
#include "GossipDef.h"
#include "QuestDef.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "WorldPacket.h"
@ -37,7 +37,7 @@ GossipMenu::~GossipMenu()
void GossipMenu::AddMenuItem(uint8 Icon, const std::string& Message, uint32 dtSender, uint32 dtAction, const std::string& BoxMessage, uint32 BoxMoney, bool Coded)
{
ASSERT( m_gItems.size() <= GOSSIP_MAX_MENU_ITEMS );
MANGOS_ASSERT( m_gItems.size() <= GOSSIP_MAX_MENU_ITEMS );
GossipMenuItem gItem;
@ -363,7 +363,7 @@ void QuestMenu::AddMenuItem( uint32 QuestId, uint8 Icon)
if (!qinfo)
return;
ASSERT( m_qItems.size() <= GOSSIP_MAX_MENU_ITEMS );
MANGOS_ASSERT( m_qItems.size() <= GOSSIP_MAX_MENU_ITEMS );
QuestMenuItem qItem;

View file

@ -16,9 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Common.h"
#include "Database/SQLStorage.h"
#include "InstanceSaveMgr.h"
#include "Database/SQLStorage.h"
#include "Player.h"
#include "GridNotifiers.h"
#include "Log.h"
@ -27,7 +27,6 @@
#include "Map.h"
#include "MapManager.h"
#include "MapInstanced.h"
#include "InstanceSaveMgr.h"
#include "Timer.h"
#include "GridNotifiersImpl.h"
#include "Transports.h"
@ -74,7 +73,7 @@ void InstanceSave::SaveToDB()
Map *map = sMapMgr.FindMap(GetMapId(),m_instanceid);
if(map)
{
ASSERT(map->IsDungeon());
MANGOS_ASSERT(map->IsDungeon());
InstanceData *iData = ((InstanceMap *)map)->GetInstanceData();
if(iData && iData->Save())
{
@ -437,7 +436,7 @@ void InstanceSaveManager::RemoveInstanceSave(uint32 InstanceId)
void InstanceSaveManager::_DelHelper(DatabaseType &db, const char *fields, const char *table, const char *queryTail,...)
{
Tokens fieldTokens = StrSplit(fields, ", ");
ASSERT(fieldTokens.size() != 0);
MANGOS_ASSERT(fieldTokens.size() != 0);
va_list ap;
char szQueryTail [MAX_QUERY_LEN];

View file

@ -19,6 +19,7 @@
#ifndef __InstanceSaveMgr_H
#define __InstanceSaveMgr_H
#include "Common.h"
#include "Platform/Define.h"
#include "Policies/Singleton.h"
#include "ace/Thread_Mutex.h"
@ -31,6 +32,7 @@
struct InstanceTemplate;
struct MapEntry;
struct MapDifficulty;
class Player;
class Group;

View file

@ -16,7 +16,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Common.h"
#include "Item.h"
#include "ObjectMgr.h"
#include "ObjectGuid.h"
@ -159,7 +158,7 @@ void RemoveItemsSetItem(Player*player,ItemPrototype const *proto)
if(!eff->item_count) //all items of a set were removed
{
ASSERT(eff == player->ItemSetEff[setindex]);
MANGOS_ASSERT(eff == player->ItemSetEff[setindex]);
delete eff;
player->ItemSetEff[setindex] = NULL;
}
@ -953,7 +952,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");
MANGOS_ASSERT(count !=0 && "pProto->Stackable==0 but checked at loading already");
Item *pItem = NewItemOrBag( pProto );
if( pItem->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_ITEM), item, player) )

View file

@ -854,7 +854,7 @@ MailReceiver::MailReceiver( Player* receiver ) : m_receiver(receiver), m_receive
*/
MailReceiver::MailReceiver( Player* receiver,uint32 receiver_lowguid ) : m_receiver(receiver), m_receiver_lowguid(receiver_lowguid)
{
ASSERT(!receiver || receiver->GetGUIDLow() == receiver_lowguid);
MANGOS_ASSERT(!receiver || receiver->GetGUIDLow() == receiver_lowguid);
}
/**

View file

@ -16,6 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Map.h"
#include "MapManager.h"
#include "Player.h"
#include "Vehicle.h"
@ -24,7 +25,6 @@
#include "GridStates.h"
#include "CellImpl.h"
#include "InstanceData.h"
#include "Map.h"
#include "GridNotifiersImpl.h"
#include "Transports.h"
#include "ObjectAccessor.h"
@ -331,7 +331,7 @@ bool Map::EnsureGridLoaded(const Cell &cell)
EnsureGridCreated(GridPair(cell.GridX(), cell.GridY()));
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
ASSERT(grid != NULL);
MANGOS_ASSERT(grid != NULL);
if( !isGridObjectDataLoaded(cell.GridX(), cell.GridY()) )
{
ObjectGridLoader loader(*grid, this, cell);
@ -381,7 +381,7 @@ template<class T>
void
Map::Add(T *obj)
{
ASSERT(obj);
MANGOS_ASSERT(obj);
CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
@ -399,7 +399,7 @@ Map::Add(T *obj)
EnsureGridCreated(GridPair(cell.GridX(), cell.GridY()));
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
ASSERT( grid != NULL );
MANGOS_ASSERT( grid != NULL );
AddToGrid(obj,grid,cell);
obj->AddToWorld();
@ -633,7 +633,7 @@ void Map::Update(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);
MANGOS_ASSERT(grid->GetGridState() >= 0 && grid->GetGridState() < MAX_GRID_STATE);
sMapMgr.UpdateGridState(grid->GetGridState(), *this, *grid, *info, grid->getX(), grid->getY(), t_diff);
}
}
@ -680,7 +680,7 @@ void Map::Remove(Player *player, bool remove)
DEBUG_FILTER_LOG(LOG_FILTER_PLAYER_MOVES, "Remove player %s from grid[%u,%u]", player->GetName(), cell.GridX(), cell.GridY());
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
ASSERT(grid != NULL);
MANGOS_ASSERT(grid != NULL);
RemoveFromGrid(player,grid,cell);
@ -709,7 +709,7 @@ Map::Remove(T *obj, bool remove)
DEBUG_LOG("Remove object (GUID: %u TypeId:%u) from grid[%u,%u]", obj->GetGUIDLow(), obj->GetTypeId(), cell.data.Part.grid_x, cell.data.Part.grid_y);
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
ASSERT( grid != NULL );
MANGOS_ASSERT( grid != NULL );
if(obj->isActiveObject())
RemoveFromActive(obj);
@ -735,7 +735,7 @@ Map::Remove(T *obj, bool remove)
void
Map::PlayerRelocation(Player *player, float x, float y, float z, float orientation)
{
ASSERT(player);
MANGOS_ASSERT(player);
CellPair old_val = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
CellPair new_val = MaNGOS::ComputeCellPair(x, y);
@ -782,7 +782,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));
MANGOS_ASSERT(CheckGridIntegrity(creature,false));
Cell old_cell = creature->GetCurrentCell();
@ -822,7 +822,7 @@ Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang
}
creature->GetViewPoint().Call_UpdateVisibilityForOwner();
ASSERT(CheckGridIntegrity(creature,true));
MANGOS_ASSERT(CheckGridIntegrity(creature,true));
}
bool Map::CreatureCellRelocation(Creature *c, Cell new_cell)
@ -915,7 +915,7 @@ bool Map::CreatureRespawnRelocation(Creature *c)
bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool pForce)
{
NGridType *grid = getNGrid(x, y);
ASSERT( grid != NULL);
MANGOS_ASSERT( grid != NULL);
{
if(!pForce && ActiveObjectsNearGrid(x, y) )
@ -1422,14 +1422,14 @@ 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);
MANGOS_ASSERT(false);
}
i_grids[x][y] = grid;
}
void Map::AddObjectToRemoveList(WorldObject *obj)
{
ASSERT(obj->GetMapId()==GetId() && obj->GetInstanceId()==GetInstanceId());
MANGOS_ASSERT(obj->GetMapId()==GetId() && obj->GetInstanceId()==GetInstanceId());
obj->CleanupsBeforeDelete(); // remove or simplify at least cross referenced links
@ -1494,8 +1494,8 @@ void Map::SendToPlayers(WorldPacket const* data) const
bool Map::ActiveObjectsNearGrid(uint32 x, uint32 y) const
{
ASSERT(x < MAX_NUMBER_OF_GRIDS);
ASSERT(y < MAX_NUMBER_OF_GRIDS);
MANGOS_ASSERT(x < MAX_NUMBER_OF_GRIDS);
MANGOS_ASSERT(y < MAX_NUMBER_OF_GRIDS);
CellPair cell_min(x*MAX_NUMBER_OF_CELLS, y*MAX_NUMBER_OF_CELLS);
CellPair cell_max(cell_min.x_coord + MAX_NUMBER_OF_CELLS, cell_min.y_coord+MAX_NUMBER_OF_CELLS);
@ -1648,7 +1648,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);
MANGOS_ASSERT(false);
return false;
}
@ -1704,7 +1704,7 @@ bool InstanceMap::Add(Player *player)
GetInstanceSave()->GetMapId(), GetInstanceSave()->GetInstanceId(),
GetInstanceSave()->GetDifficulty(), GetInstanceSave()->GetPlayerCount(),
GetInstanceSave()->GetGroupCount(), GetInstanceSave()->CanReset());
ASSERT(false);
MANGOS_ASSERT(false);
}
}
else
@ -1728,7 +1728,7 @@ bool InstanceMap::Add(Player *player)
pGroup->GetId(),
groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(),
groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset());
ASSERT(false);
MANGOS_ASSERT(false);
}
// bind to the group or keep using the group save
if (!groupBind)
@ -1754,7 +1754,7 @@ bool InstanceMap::Add(Player *player)
sLog.outError("GroupBind save players: %d, group count: %d", groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount());
else
sLog.outError("GroupBind save NULL");
ASSERT(false);
MANGOS_ASSERT(false);
}
// if the group/leader is permanently bound to the instance
// players also become permanently bound when they enter
@ -1774,7 +1774,7 @@ bool InstanceMap::Add(Player *player)
player->BindToInstance(GetInstanceSave(), false);
else
// cannot jump to a different instance without resetting it
ASSERT(playerBind->save == GetInstanceSave());
MANGOS_ASSERT(playerBind->save == GetInstanceSave());
}
}
}
@ -1994,7 +1994,7 @@ bool BattleGroundMap::CanEnter(Player * player)
if(player->GetMapRef().getTarget() == this)
{
sLog.outError("BGMap::CanEnter - player %u already in map!", player->GetGUIDLow());
ASSERT(false);
MANGOS_ASSERT(false);
return false;
}
@ -3051,9 +3051,9 @@ uint32 Map::GenerateLocalLowGuid(HighGuid guidhigh)
case HIGHGUID_VEHICLE:
return m_VehicleGuids.Generate();
default:
ASSERT(0);
MANGOS_ASSERT(0);
}
ASSERT(0);
MANGOS_ASSERT(0);
return 0;
}

View file

@ -19,6 +19,7 @@
#ifndef MANGOS_MAP_H
#define MANGOS_MAP_H
#include "Common.h"
#include "Platform/Define.h"
#include "Policies/ThreadingModel.h"
#include "ace/RW_Thread_Mutex.h"
@ -296,8 +297,8 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
NGridType* getNGrid(uint32 x, uint32 y) const
{
ASSERT(x < MAX_NUMBER_OF_GRIDS);
ASSERT(y < MAX_NUMBER_OF_GRIDS);
MANGOS_ASSERT(x < MAX_NUMBER_OF_GRIDS);
MANGOS_ASSERT(y < MAX_NUMBER_OF_GRIDS);
return i_grids[x][y];
}

View file

@ -103,9 +103,9 @@ Map* MapInstanced::CreateInstance(Player * player)
{
// find existing bg map for player
NewInstanceId = player->GetBattleGroundId();
ASSERT(NewInstanceId);
MANGOS_ASSERT(NewInstanceId);
map = _FindMap(NewInstanceId);
ASSERT(map);
MANGOS_ASSERT(map);
}
else if (InstanceSave* pSave = player->GetBoundInstanceSaveForSelfOrGroup(GetId()))
{
@ -138,12 +138,12 @@ InstanceMap* MapInstanced::CreateInstanceMap(uint32 InstanceId, Difficulty diffi
if (!sMapStore.LookupEntry(GetId()))
{
sLog.outError("CreateInstanceMap: no entry for map %d", GetId());
ASSERT(false);
MANGOS_ASSERT(false);
}
if (!ObjectMgr::GetInstanceTemplate(GetId()))
{
sLog.outError("CreateInstanceMap: no instance template for map %d", GetId());
ASSERT(false);
MANGOS_ASSERT(false);
}
// some instances only have one difficulty
@ -153,7 +153,7 @@ InstanceMap* MapInstanced::CreateInstanceMap(uint32 InstanceId, Difficulty diffi
DEBUG_LOG("MapInstanced::CreateInstanceMap: %s map instance %d for %d created with difficulty %d", save?"":"new ", InstanceId, GetId(), difficulty);
InstanceMap *map = new InstanceMap(GetId(), GetGridExpiry(), InstanceId, difficulty, this);
ASSERT(map->IsDungeon());
MANGOS_ASSERT(map->IsDungeon());
bool load_data = save != NULL;
map->CreateInstanceData(load_data);
@ -174,7 +174,7 @@ BattleGroundMap* MapInstanced::CreateBattleGroundMap(uint32 InstanceId, BattleGr
uint8 spawnMode = bracketEntry ? bracketEntry->difficulty : REGULAR_DIFFICULTY;
BattleGroundMap *map = new BattleGroundMap(GetId(), GetGridExpiry(), InstanceId, this, spawnMode);
ASSERT(map->IsBattleGroundOrArena());
MANGOS_ASSERT(map->IsBattleGroundOrArena());
map->SetBG(bg);
bg->SetBgMap(map);

View file

@ -19,6 +19,7 @@
#ifndef MANGOS_MAP_INSTANCED_H
#define MANGOS_MAP_INSTANCED_H
#include "Common.h"
#include "Map.h"
#include "InstanceSaveMgr.h"
#include "DBCEnums.h"

View file

@ -110,13 +110,13 @@ MapManager::_createBaseMap(uint32 id)
i_maps[id] = m;
}
ASSERT(m != NULL);
MANGOS_ASSERT(m != NULL);
return m;
}
Map* MapManager::CreateMap(uint32 id, const WorldObject* obj)
{
ASSERT(obj);
MANGOS_ASSERT(obj);
//if(!obj->IsInWorld()) sLog.outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId());
Map *m = _createBaseMap(id);

View file

@ -19,10 +19,10 @@
#ifndef MANGOS_MAPMANAGER_H
#define MANGOS_MAPMANAGER_H
#include "Common.h"
#include "Platform/Define.h"
#include "Policies/Singleton.h"
#include "ace/Thread_Mutex.h"
#include "Common.h"
#include "Map.h"
#include "GridStates.h"

View file

@ -69,7 +69,7 @@ MotionMaster::UpdateMotion(uint32 diff)
{
if( i_owner->hasUnitState(UNIT_STAT_CAN_NOT_MOVE) )
return;
ASSERT( !empty() );
MANGOS_ASSERT( !empty() );
m_cleanFlag |= MMCF_UPDATE;
if (!top()->Update(*i_owner, diff))
{
@ -116,7 +116,7 @@ MotionMaster::DirectClean(bool reset, bool all)
if (!all && reset)
{
ASSERT( !empty() );
MANGOS_ASSERT( !empty() );
top()->Reset(*i_owner);
}
}

View file

@ -19,11 +19,11 @@
#ifndef MANGOS_MOVEMENTGENERATOR_H
#define MANGOS_MOVEMENTGENERATOR_H
#include "Common.h"
#include "Platform/Define.h"
#include "Policies/Singleton.h"
#include "Dynamic/ObjectRegistry.h"
#include "Dynamic/FactoryHolder.h"
#include "Common.h"
#include "MotionMaster.h"
class Unit;

View file

@ -16,13 +16,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Common.h"
#include "Object.h"
#include "SharedDefines.h"
#include "WorldPacket.h"
#include "Opcodes.h"
#include "Log.h"
#include "World.h"
#include "Object.h"
#include "Creature.h"
#include "Player.h"
#include "Vehicle.h"
@ -82,13 +81,13 @@ Object::~Object( )
{
///- Do NOT call RemoveFromWorld here, if the object is a player it will crash
sLog.outError("Object::~Object (GUID: %u TypeId: %u) deleted but still in world!!", GetGUIDLow(), GetTypeId());
ASSERT(false);
MANGOS_ASSERT(false);
}
if(m_objectUpdated)
{
sLog.outError("Object::~Object (GUID: %u TypeId: %u) deleted but still have updated status!!", GetGUIDLow(), GetTypeId());
ASSERT(false);
MANGOS_ASSERT(false);
}
if(m_uint32Values)
@ -237,7 +236,7 @@ void Object::BuildOutOfRangeUpdateBlock(UpdateData * data) const
void Object::DestroyForPlayer( Player *target, bool anim ) const
{
ASSERT(target);
MANGOS_ASSERT(target);
WorldPacket data(SMSG_DESTROY_OBJECT, 8);
data << GetObjectGuid();
@ -305,7 +304,7 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const
if(player->IsTaxiFlying())
{
ASSERT(player->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE);
MANGOS_ASSERT(player->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE);
player->m_movementInfo.AddMovementFlag(MOVEFLAG_FORWARD);
player->m_movementInfo.AddMovementFlag(MOVEFLAG_SPLINE_ENABLED);
}
@ -346,7 +345,7 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const
return;
}
ASSERT(player->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE);
MANGOS_ASSERT(player->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE);
FlightPathMovementGenerator *fmg = (FlightPathMovementGenerator*)(player->GetMotionMaster()->top());
@ -583,7 +582,7 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *
}
}
ASSERT(updateMask && updateMask->GetCount() == m_valuesCount);
MANGOS_ASSERT(updateMask && updateMask->GetCount() == m_valuesCount);
*data << (uint8)updateMask->GetBlockCount();
data->append( updateMask->GetMask(), updateMask->GetLength() );
@ -782,7 +781,7 @@ void Object::_SetCreateBits(UpdateMask *updateMask, Player* /*target*/) const
void Object::SetInt32Value( uint16 index, int32 value )
{
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(m_int32Values[ index ] != value)
{
@ -801,7 +800,7 @@ void Object::SetInt32Value( uint16 index, int32 value )
void Object::SetUInt32Value( uint16 index, uint32 value )
{
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(m_uint32Values[ index ] != value)
{
@ -820,7 +819,7 @@ void Object::SetUInt32Value( uint16 index, uint32 value )
void Object::SetUInt64Value( uint16 index, const uint64 &value )
{
ASSERT( index + 1 < m_valuesCount || PrintIndexError( index, true ) );
MANGOS_ASSERT( index + 1 < m_valuesCount || PrintIndexError( index, true ) );
if(*((uint64*)&(m_uint32Values[ index ])) != value)
{
m_uint32Values[ index ] = *((uint32*)&value);
@ -839,7 +838,7 @@ void Object::SetUInt64Value( uint16 index, const uint64 &value )
void Object::SetFloatValue( uint16 index, float value )
{
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(m_floatValues[ index ] != value)
{
@ -858,7 +857,7 @@ void Object::SetFloatValue( uint16 index, float value )
void Object::SetByteValue( uint16 index, uint8 offset, uint8 value )
{
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(offset > 4)
{
@ -884,7 +883,7 @@ void Object::SetByteValue( uint16 index, uint8 offset, uint8 value )
void Object::SetUInt16Value( uint16 index, uint8 offset, uint16 value )
{
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(offset > 2)
{
@ -958,7 +957,7 @@ void Object::ApplyModPositiveFloatValue(uint16 index, float val, bool apply)
void Object::SetFlag( uint16 index, uint32 newFlag )
{
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
uint32 oldval = m_uint32Values[ index ];
uint32 newval = oldval | newFlag;
@ -979,7 +978,7 @@ void Object::SetFlag( uint16 index, uint32 newFlag )
void Object::RemoveFlag( uint16 index, uint32 oldFlag )
{
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
uint32 oldval = m_uint32Values[ index ];
uint32 newval = oldval & ~oldFlag;
@ -1000,7 +999,7 @@ void Object::RemoveFlag( uint16 index, uint32 oldFlag )
void Object::SetByteFlag( uint16 index, uint8 offset, uint8 newFlag )
{
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(offset > 4)
{
@ -1025,7 +1024,7 @@ void Object::SetByteFlag( uint16 index, uint8 offset, uint8 newFlag )
void Object::RemoveByteFlag( uint16 index, uint8 offset, uint8 oldFlag )
{
ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index, true ) );
if(offset > 4)
{
@ -1063,7 +1062,7 @@ void Object::BuildUpdateDataForPlayer(Player* pl, UpdateDataMapType& update_play
if (iter == update_players.end())
{
std::pair<UpdateDataMapType::iterator, bool> p = update_players.insert( UpdateDataMapType::value_type(pl, UpdateData()) );
ASSERT(p.second);
MANGOS_ASSERT(p.second);
iter = p.first;
}
@ -1073,19 +1072,19 @@ void Object::BuildUpdateDataForPlayer(Player* pl, UpdateDataMapType& update_play
void Object::AddToClientUpdateList()
{
sLog.outError("Unexpected call of Object::AddToClientUpdateList for object (TypeId: %u Update fields: %u)",GetTypeId(), m_valuesCount);
ASSERT(false);
MANGOS_ASSERT(false);
}
void Object::RemoveFromClientUpdateList()
{
sLog.outError("Unexpected call of Object::RemoveFromClientUpdateList for object (TypeId: %u Update fields: %u)",GetTypeId(), m_valuesCount);
ASSERT(false);
MANGOS_ASSERT(false);
}
void Object::BuildUpdateData( UpdateDataMapType& /*update_players */)
{
sLog.outError("Unexpected call of Object::BuildUpdateData for object (TypeId: %u Update fields: %u)",GetTypeId(), m_valuesCount);
ASSERT(false);
MANGOS_ASSERT(false);
}
WorldObject::WorldObject()
@ -1610,7 +1609,7 @@ void WorldObject::SendGameObjectCustomAnim(uint64 guid)
void WorldObject::SetMap(Map * map)
{
ASSERT(map);
MANGOS_ASSERT(map);
m_currMap = map;
//lets save current map's Id/instanceId
m_mapId = map->GetId();
@ -1619,7 +1618,7 @@ void WorldObject::SetMap(Map * map)
Map const* WorldObject::GetBaseMap() const
{
ASSERT(m_currMap);
MANGOS_ASSERT(m_currMap);
return m_currMap->GetParent();
}

View file

@ -144,39 +144,39 @@ class MANGOS_DLL_SPEC Object
const int32& GetInt32Value( uint16 index ) const
{
ASSERT( index < m_valuesCount || PrintIndexError( index , false) );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index , false) );
return m_int32Values[ index ];
}
const uint32& GetUInt32Value( uint16 index ) const
{
ASSERT( index < m_valuesCount || PrintIndexError( index , false) );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index , false) );
return m_uint32Values[ index ];
}
const uint64& GetUInt64Value( uint16 index ) const
{
ASSERT( index + 1 < m_valuesCount || PrintIndexError( index , false) );
MANGOS_ASSERT( index + 1 < m_valuesCount || PrintIndexError( index , false) );
return *((uint64*)&(m_uint32Values[ index ]));
}
const float& GetFloatValue( uint16 index ) const
{
ASSERT( index < m_valuesCount || PrintIndexError( index , false ) );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index , false ) );
return m_floatValues[ index ];
}
uint8 GetByteValue( uint16 index, uint8 offset) const
{
ASSERT( index < m_valuesCount || PrintIndexError( index , false) );
ASSERT( offset < 4 );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index , false) );
MANGOS_ASSERT( offset < 4 );
return *(((uint8*)&m_uint32Values[ index ])+offset);
}
uint16 GetUInt16Value( uint16 index, uint8 offset) const
{
ASSERT( index < m_valuesCount || PrintIndexError( index , false) );
ASSERT( offset < 2 );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index , false) );
MANGOS_ASSERT( offset < 2 );
return *(((uint16*)&m_uint32Values[ index ])+offset);
}
@ -218,7 +218,7 @@ class MANGOS_DLL_SPEC Object
bool HasFlag( uint16 index, uint32 flag ) const
{
ASSERT( index < m_valuesCount || PrintIndexError( index , false ) );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index , false ) );
return (m_uint32Values[ index ] & flag) != 0;
}
@ -235,8 +235,8 @@ class MANGOS_DLL_SPEC Object
bool HasByteFlag( uint16 index, uint8 offset, uint8 flag ) const
{
ASSERT( index < m_valuesCount || PrintIndexError( index , false ) );
ASSERT( offset < 4 );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index , false ) );
MANGOS_ASSERT( offset < 4 );
return (((uint8*)&m_uint32Values[index])[offset] & flag) != 0;
}
@ -269,7 +269,7 @@ class MANGOS_DLL_SPEC Object
bool HasFlag64( uint16 index, uint64 flag ) const
{
ASSERT( index < m_valuesCount || PrintIndexError( index , false ) );
MANGOS_ASSERT( index < m_valuesCount || PrintIndexError( index , false ) );
return (GetUInt64Value( index ) & flag) != 0;
}
@ -474,7 +474,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object
virtual bool isVisibleForInState(Player const* u, WorldObject const* viewPoint, bool inVisibleList) const = 0;
void SetMap(Map * map);
Map * GetMap() const { ASSERT(m_currMap); return m_currMap; }
Map * GetMap() const { MANGOS_ASSERT(m_currMap); return m_currMap; }
//used to check all object's GetMap() calls when object is not in world!
void ResetMap() { m_currMap = NULL; }

View file

@ -128,7 +128,7 @@ ObjectAccessor::GetCorpseForPlayerGUID(ObjectGuid guid)
Player2CorpsesMapType::iterator iter = i_player2corpse.find(guid.GetRawValue());
if( iter == i_player2corpse.end() ) return NULL;
ASSERT(iter->second->GetType() != CORPSE_BONES);
MANGOS_ASSERT(iter->second->GetType() != CORPSE_BONES);
return iter->second;
}
@ -136,7 +136,7 @@ ObjectAccessor::GetCorpseForPlayerGUID(ObjectGuid guid)
void
ObjectAccessor::RemoveCorpse(Corpse *corpse)
{
ASSERT(corpse && corpse->GetType() != CORPSE_BONES);
MANGOS_ASSERT(corpse && corpse->GetType() != CORPSE_BONES);
Guard guard(i_corpseGuard);
Player2CorpsesMapType::iterator iter = i_player2corpse.find(corpse->GetOwnerGUID());
@ -156,10 +156,10 @@ ObjectAccessor::RemoveCorpse(Corpse *corpse)
void
ObjectAccessor::AddCorpse(Corpse *corpse)
{
ASSERT(corpse && corpse->GetType() != CORPSE_BONES);
MANGOS_ASSERT(corpse && corpse->GetType() != CORPSE_BONES);
Guard guard(i_corpseGuard);
ASSERT(i_player2corpse.find(corpse->GetOwnerGUID()) == i_player2corpse.end());
MANGOS_ASSERT(i_player2corpse.find(corpse->GetOwnerGUID()) == i_player2corpse.end());
i_player2corpse[corpse->GetOwnerGUID()] = corpse;
// build mapid*cellid -> guid_set map

View file

@ -19,6 +19,7 @@
#ifndef MANGOS_OBJECTACCESSOR_H
#define MANGOS_OBJECTACCESSOR_H
#include "Common.h"
#include "Platform/Define.h"
#include "Policies/Singleton.h"
#include <ace/Thread_Mutex.h>

View file

@ -57,7 +57,7 @@ ObjectGridRespawnMover::Visit(CreatureMapType &m)
Creature * c = iter->getSource();
ASSERT((!c->isPet() || !c->isVehicle()) && "ObjectGridRespawnMover don't must be called for pets");
MANGOS_ASSERT((!c->isPet() || !c->isVehicle()) && "ObjectGridRespawnMover don't must be called for pets");
Cell const& cur_cell = c->GetCurrentCell();

View file

@ -19,6 +19,7 @@
#ifndef MANGOS_OBJECTGRIDLOADER_H
#define MANGOS_OBJECTGRIDLOADER_H
#include "Common.h"
#include "Utilities/TypeList.h"
#include "Platform/Define.h"
#include "GameSystem/GridLoader.h"

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Common.h"
#include "ObjectMgr.h"
#include "Database/DatabaseEnv.h"
#include "Database/SQLStorage.h"
#include "Database/SQLStorageImpl.h"
@ -24,7 +24,6 @@
#include "Log.h"
#include "MapManager.h"
#include "ObjectMgr.h"
#include "ObjectGuid.h"
#include "SpellMgr.h"
#include "UpdateMask.h"
@ -6106,10 +6105,10 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
case HIGHGUID_CORPSE:
return m_CorpseGuids.Generate();
default:
ASSERT(0);
MANGOS_ASSERT(0);
}
ASSERT(0);
MANGOS_ASSERT(0);
return 0;
}

View file

@ -19,6 +19,7 @@
#ifndef _OBJECTMGR_H
#define _OBJECTMGR_H
#include "Common.h"
#include "Log.h"
#include "Object.h"
#include "Bag.h"

View file

@ -16,13 +16,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Common.h"
#include "Pet.h"
#include "Database/DatabaseEnv.h"
#include "Log.h"
#include "WorldPacket.h"
#include "ObjectMgr.h"
#include "SpellMgr.h"
#include "Pet.h"
#include "Formulas.h"
#include "SpellAuras.h"
#include "CreatureAI.h"
@ -492,7 +491,7 @@ void Pet::Update(uint32 diff)
{
if( m_deathTimer <= diff )
{
ASSERT(getPetType()!=SUMMON_PET && "Must be already removed.");
MANGOS_ASSERT(getPetType()!=SUMMON_PET && "Must be already removed.");
Remove(PET_SAVE_NOT_IN_SLOT); //hunters' pets never get removed because of death, NEVER!
return;
}
@ -797,7 +796,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner)
{
CreatureInfo const *cinfo = GetCreatureInfo();
ASSERT(cinfo);
MANGOS_ASSERT(cinfo);
if(!owner)
{

View file

@ -19,6 +19,7 @@
#ifndef MANGOSSERVER_PET_H
#define MANGOSSERVER_PET_H
#include "Common.h"
#include "ObjectGuid.h"
#include "Creature.h"
#include "Unit.h"
@ -261,11 +262,11 @@ class Pet : public Creature
void SaveToDB(uint32, uint8) // overwrited of Creature::SaveToDB - don't must be called
{
ASSERT(false);
MANGOS_ASSERT(false);
}
void DeleteFromDB() // overwrited of Creature::DeleteFromDB - don't must be called
{
ASSERT(false);
MANGOS_ASSERT(false);
}
};
#endif

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Common.h"
#include "Player.h"
#include "Language.h"
#include "Database/DatabaseEnv.h"
#include "Log.h"
@ -26,7 +26,6 @@
#include "WorldPacket.h"
#include "WorldSession.h"
#include "UpdateMask.h"
#include "Player.h"
#include "Vehicle.h"
#include "SkillDiscovery.h"
#include "QuestDef.h"
@ -4424,7 +4423,7 @@ void Player::BuildPlayerRepop()
if(GetCorpse())
{
sLog.outError("BuildPlayerRepop: player %s(%d) already has a corpse", GetName(), GetGUIDLow());
ASSERT(false);
MANGOS_ASSERT(false);
}
// create a corpse and place it at the player's location
@ -8572,7 +8571,7 @@ void Player::SendPetSkillWipeConfirm()
void Player::SetVirtualItemSlot( uint8 i, Item* item)
{
ASSERT(i < 3);
MANGOS_ASSERT(i < 3);
if(i < 2 && item)
{
if(!item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
@ -12183,7 +12182,7 @@ void Player::UpdateEnchantTime(uint32 time)
{
for(EnchantDurationList::iterator itr = m_enchantDuration.begin(),next;itr != m_enchantDuration.end();itr=next)
{
ASSERT(itr->item);
MANGOS_ASSERT(itr->item);
next = itr;
if (!itr->item->GetEnchantmentId(itr->slot))
{
@ -13088,7 +13087,7 @@ void Player::PrepareQuestMenu( uint64 guid )
//we should obtain map pointer from GetMap() in 99% of cases. Special case
//only for quests which cast teleport spells on player
Map * _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId());
ASSERT(_map);
MANGOS_ASSERT(_map);
GameObject *pGameObject = _map->GetGameObject(guid);
if( pGameObject )
{
@ -13255,7 +13254,7 @@ Quest const * Player::GetNextQuest( uint64 guid, Quest const *pQuest )
//we should obtain map pointer from GetMap() in 99% of cases. Special case
//only for quests which cast teleport spells on player
Map * _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId());
ASSERT(_map);
MANGOS_ASSERT(_map);
GameObject *pGameObject = _map->GetGameObject(guid);
if( pGameObject )
{
@ -13484,7 +13483,7 @@ void Player::SendPetTameFailure(PetTameFailureReason reason)
void Player::AddQuest( Quest const *pQuest, Object *questGiver )
{
uint16 log_slot = FindQuestSlot( 0 );
ASSERT(log_slot < MAX_QUEST_LOG_SIZE);
MANGOS_ASSERT(log_slot < MAX_QUEST_LOG_SIZE);
uint32 quest_id = pQuest->GetQuestId();
@ -13870,7 +13869,7 @@ bool Player::SatisfyQuestPreviousQuest( Quest const* qInfo, bool msg ) const
ObjectMgr::ExclusiveQuestGroups::const_iterator iter2 = sObjectMgr.mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup());
ObjectMgr::ExclusiveQuestGroups::const_iterator end = sObjectMgr.mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup());
ASSERT(iter2!=end); // always must be found if qPrevInfo->ExclusiveGroup != 0
MANGOS_ASSERT(iter2!=end); // always must be found if qPrevInfo->ExclusiveGroup != 0
for(; iter2 != end; ++iter2)
{
@ -13904,7 +13903,7 @@ bool Player::SatisfyQuestPreviousQuest( Quest const* qInfo, bool msg ) const
ObjectMgr::ExclusiveQuestGroups::const_iterator iter2 = sObjectMgr.mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup());
ObjectMgr::ExclusiveQuestGroups::const_iterator end = sObjectMgr.mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup());
ASSERT(iter2!=end); // always must be found if qPrevInfo->ExclusiveGroup != 0
MANGOS_ASSERT(iter2!=end); // always must be found if qPrevInfo->ExclusiveGroup != 0
for(; iter2 != end; ++iter2)
{
@ -14003,7 +14002,7 @@ bool Player::SatisfyQuestExclusiveGroup( Quest const* qInfo, bool msg ) const
ObjectMgr::ExclusiveQuestGroups::const_iterator iter = sObjectMgr.mExclusiveQuestGroups.lower_bound(qInfo->GetExclusiveGroup());
ObjectMgr::ExclusiveQuestGroups::const_iterator end = sObjectMgr.mExclusiveQuestGroups.upper_bound(qInfo->GetExclusiveGroup());
ASSERT(iter!=end); // always must be found if qInfo->ExclusiveGroup != 0
MANGOS_ASSERT(iter!=end); // always must be found if qInfo->ExclusiveGroup != 0
for(; iter != end; ++iter)
{
@ -14837,7 +14836,7 @@ void Player::SendQuestUpdateAddItem( Quest const* /*pQuest*/, uint32 /*item_idx*
void Player::SendQuestUpdateAddCreatureOrGo( Quest const* pQuest, ObjectGuid 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)");
MANGOS_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)
@ -15507,7 +15506,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
{
// save source node as recall coord to prevent recall and fall from sky
TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(node_id);
ASSERT(nodeEntry); // checked in m_taxi.LoadTaxiDestinationsFromString
MANGOS_ASSERT(nodeEntry); // checked in m_taxi.LoadTaxiDestinationsFromString
m_recallMap = nodeEntry->map_id;
m_recallX = nodeEntry->x;
m_recallY = nodeEntry->y;
@ -16629,7 +16628,7 @@ void Player::ConvertInstancesToGroup(Player *player, Group *group, ObjectGuid pl
group = player->GetGroup();
}
ASSERT(!player_guid.IsEmpty());
MANGOS_ASSERT(!player_guid.IsEmpty());
// copy all binds to the group, when changing leader it's assumed the character
// will not have any solo binds
@ -18467,7 +18466,7 @@ void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs )
SpellEntry const *spellInfo = sSpellStore.LookupEntry(unSpellId);
if (!spellInfo)
{
ASSERT(spellInfo);
MANGOS_ASSERT(spellInfo);
continue;
}
@ -19491,7 +19490,7 @@ void Player::SetGroup(Group *group, int8 subgroup)
else
{
// never use SetGroup without a subgroup unless you specify NULL for group
ASSERT(subgroup >= 0);
MANGOS_ASSERT(subgroup >= 0);
m_group.link(group, this);
m_group.setSubGroup((uint8)subgroup);
}
@ -20642,7 +20641,7 @@ void Player::SetOriginalGroup(Group *group, int8 subgroup)
else
{
// never use SetOriginalGroup without a subgroup unless you specify NULL for group
ASSERT(subgroup >= 0);
MANGOS_ASSERT(subgroup >= 0);
m_originalGroup.link(group, this);
m_originalGroup.setSubGroup((uint8)subgroup);
}

View file

@ -385,7 +385,7 @@ struct Runes
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); };
EnchantDuration(Item * _item, EnchantmentSlot _slot, uint32 _leftduration) : item(_item), slot(_slot), leftduration(_leftduration) { MANGOS_ASSERT(item); };
Item * item;
EnchantmentSlot slot;
@ -1621,7 +1621,7 @@ class MANGOS_DLL_SPEC Player : public Unit
void AddMItem(Item* it)
{
ASSERT( it );
MANGOS_ASSERT( it );
//ASSERT deleted, because items can be added before loading
mMitems[it->GetGUIDLow()] = it;
}

View file

@ -339,8 +339,8 @@ void PoolGroup<T>::SpawnObject(SpawnedPoolData& spawns, uint32 limit, uint32 tri
if (obj->guid == triggerFrom)
{
ASSERT(spawns.IsSpawnedObject<T>(obj->guid));
ASSERT(spawns.GetSpawnedObjects(poolId) > 0);
MANGOS_ASSERT(spawns.IsSpawnedObject<T>(obj->guid));
MANGOS_ASSERT(spawns.GetSpawnedObjects(poolId) > 0);
ReSpawn1Object(obj);
triggerFrom = 0;
continue;

View file

@ -19,6 +19,7 @@
#ifndef MANGOS_POOLHANDLER_H
#define MANGOS_POOLHANDLER_H
#include "Common.h"
#include "Platform/Define.h"
#include "Policies/Singleton.h"
#include "Creature.h"

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Common.h"
#include "Spell.h"
#include "Database/DatabaseEnv.h"
#include "WorldPacket.h"
#include "WorldSession.h"
@ -31,7 +31,6 @@
#include "Player.h"
#include "Pet.h"
#include "Unit.h"
#include "Spell.h"
#include "DynamicObject.h"
#include "Group.h"
#include "UpdateData.h"
@ -322,8 +321,8 @@ void SpellCastTargets::write( ByteBuffer& data ) const
Spell::Spell( Unit* caster, SpellEntry const *info, bool triggered, ObjectGuid originalCasterGUID, Spell** triggeringContainer )
{
ASSERT( caster != NULL && info != NULL );
ASSERT( info == sSpellStore.LookupEntry( info->Id ) && "`info` must be pointer to sSpellStore element");
MANGOS_ASSERT( caster != NULL && info != NULL );
MANGOS_ASSERT( info == sSpellStore.LookupEntry( info->Id ) && "`info` must be pointer to sSpellStore element");
if (info->SpellDifficultyId && caster->GetTypeId() != TYPEID_PLAYER && caster->IsInWorld() && caster->GetMap()->IsDungeon())
{

View file

@ -19,6 +19,7 @@
#ifndef __SPELL_H
#define __SPELL_H
#include "Common.h"
#include "GridDefines.h"
#include "SharedDefines.h"
#include "DBCEnums.h"
@ -690,7 +691,7 @@ namespace MaNGOS
template<class T> inline void Visit(GridRefManager<T> &m)
{
ASSERT(i_data);
MANGOS_ASSERT(i_data);
if(!i_originalCaster)
return;

View file

@ -377,9 +377,9 @@ m_timeCla(1000), m_periodicTimer(0), m_periodicTick(0), m_removeMode(AURA_REMOVE
m_effIndex(eff), m_spellAuraHolder(holder), m_isPersistent(false),
m_positive(false), m_isPeriodic(false), m_isAreaAura(false), m_in_use(0)
{
ASSERT(target);
MANGOS_ASSERT(target);
ASSERT(spellproto && spellproto == sSpellStore.LookupEntry( spellproto->Id ) && "`info` must be pointer to sSpellStore element");
MANGOS_ASSERT(spellproto && spellproto == sSpellStore.LookupEntry( spellproto->Id ) && "`info` must be pointer to sSpellStore element");
m_currentBasePoints = currentBasePoints ? *currentBasePoints : spellproto->CalculateSimpleValue(eff);
@ -503,7 +503,7 @@ Unit *caster, Item* castItem) : Aura(spellproto, eff, currentBasePoints, holder,
break;
default:
sLog.outError("Wrong spell effect in AreaAura constructor");
ASSERT(false);
MANGOS_ASSERT(false);
break;
}
}
@ -7704,15 +7704,15 @@ m_castItemGuid(castItem?castItem->GetGUID():0), m_permanent(false),
m_isRemovedOnShapeLost(true), m_in_use(0), m_deleted(false), m_removeMode(AURA_REMOVE_BY_DEFAULT), m_AuraDRGroup(DIMINISHING_NONE), m_auraSlot(MAX_AURAS),
m_auraFlags(AFLAG_NONE), m_auraLevel(1), m_procCharges(0), m_stackAmount(1)
{
ASSERT(target);
ASSERT(spellproto && spellproto == sSpellStore.LookupEntry( spellproto->Id ) && "`info` must be pointer to sSpellStore element");
MANGOS_ASSERT(target);
MANGOS_ASSERT(spellproto && spellproto == sSpellStore.LookupEntry( spellproto->Id ) && "`info` must be pointer to sSpellStore element");
if(!caster)
m_caster_guid = target->GetGUID();
else
{
// remove this assert when not unit casters will be supported
ASSERT(caster->GetObjectGuid().IsUnit())
MANGOS_ASSERT(caster->GetObjectGuid().IsUnit())
m_caster_guid = caster->GetGUID();
}
@ -8875,7 +8875,7 @@ void SpellAuraHolder::UnregisterSingleCastHolder()
else
{
sLog.outError("Couldn't find the caster of the single target aura (SpellId %u), may crash later!", GetId());
ASSERT(false);
MANGOS_ASSERT(false);
}
m_isSingleTarget = false;
}

View file

@ -2314,7 +2314,7 @@ static void LoadSpellChains_AbilityHelper(SpellChainMap& chainMap, AbilitySpellP
SpellChainMap::const_iterator chain_itr = chainMap.find(spell_id);
if (chain_itr != chainMap.end())
{
ASSERT(chain_itr->second.prev == prev_id && "LoadSpellChains_AbilityHelper: Conflicting data in talents or spell abilities dbc");
MANGOS_ASSERT(chain_itr->second.prev == prev_id && "LoadSpellChains_AbilityHelper: Conflicting data in talents or spell abilities dbc");
return;
}
@ -2353,7 +2353,7 @@ static void LoadSpellChains_AbilityHelper(SpellChainMap& chainMap, AbilitySpellP
if (deep == 0)
{
ASSERT(false && "LoadSpellChains_AbilityHelper: Infinity cycle in spell ability data");
MANGOS_ASSERT(false && "LoadSpellChains_AbilityHelper: Infinity cycle in spell ability data");
return;
}
@ -2448,7 +2448,7 @@ void SpellMgr::LoadSpellChains()
SpellChainMap::const_iterator chain_itr = mSpellChains.find(forward_id);
if (chain_itr != mSpellChains.end())
{
ASSERT(chain_itr->second.prev == spell_id && "Conflicting data in talents or spell abilities dbc");
MANGOS_ASSERT(chain_itr->second.prev == spell_id && "Conflicting data in talents or spell abilities dbc");
continue;
}
@ -2456,7 +2456,7 @@ void SpellMgr::LoadSpellChains()
AbilitySpellPrevMap::const_iterator prev_itr = prevRanks.find(forward_id);
if (prev_itr != prevRanks.end())
{
ASSERT(prev_itr->second == spell_id && "Conflicting data in talents or spell abilities dbc");
MANGOS_ASSERT(prev_itr->second == spell_id && "Conflicting data in talents or spell abilities dbc");
continue;
}
@ -3203,7 +3203,7 @@ bool SpellMgr::LoadPetDefaultSpells_helper(CreatureInfo const* cInfo, PetDefault
void SpellMgr::LoadPetDefaultSpells()
{
ASSERT(MAX_CREATURE_SPELL_DATA_SLOT==CREATURE_MAX_SPELLS);
MANGOS_ASSERT(MAX_CREATURE_SPELL_DATA_SLOT==CREATURE_MAX_SPELLS);
mPetDefaultSpellsMap.clear();

View file

@ -22,6 +22,7 @@
// For static or at-server-startup loaded spell data
// For more high level function for sSpellStore data
#include "Common.h"
#include "SharedDefines.h"
#include "SpellAuraDefines.h"
#include "DBCStructure.h"

View file

@ -291,7 +291,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 !
MANGOS_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_DAMAGE)) )
@ -388,7 +388,7 @@ void ThreatManager::addThreat(Unit* pVictim, float pThreat, bool crit, SpellScho
if(!pVictim->isAlive() || !getOwner()->isAlive() )
return;
ASSERT(getOwner()->GetTypeId()== TYPEID_UNIT);
MANGOS_ASSERT(getOwner()->GetTypeId()== TYPEID_UNIT);
float threat = ThreatCalcHelper::calcThreat(pVictim, iOwner, pThreat, crit, schoolMask, pThreatSpell);

View file

@ -19,6 +19,7 @@
#ifndef MANGOS_TRAVELLER_H
#define MANGOS_TRAVELLER_H
#include "Common.h"
#include "Creature.h"
#include "Player.h"
#include <cassert>
@ -48,7 +49,7 @@ struct MANGOS_DLL_DECL 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) { MANGOS_ASSERT(false); return 0.0f; }
float GetMoveDestinationTo(float x, float y, float z);
uint32 GetTotalTravelTimeTo(float x, float y, float z);

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "Common.h"
#include "Unit.h"
#include "Log.h"
#include "Opcodes.h"
#include "WorldPacket.h"
@ -25,7 +25,6 @@
#include "ObjectMgr.h"
#include "ObjectGuid.h"
#include "SpellMgr.h"
#include "Unit.h"
#include "QuestDef.h"
#include "Player.h"
#include "Creature.h"
@ -261,10 +260,10 @@ Unit::~Unit()
delete m_charmInfo;
// those should be already removed at "RemoveFromWorld()" call
ASSERT(m_gameObj.size() == 0);
ASSERT(m_dynObjGUIDs.size() == 0);
ASSERT(m_deletedAuras.size() == 0);
ASSERT(m_deletedHolders.size() == 0);
MANGOS_ASSERT(m_gameObj.size() == 0);
MANGOS_ASSERT(m_dynObjGUIDs.size() == 0);
MANGOS_ASSERT(m_deletedAuras.size() == 0);
MANGOS_ASSERT(m_deletedHolders.size() == 0);
}
void Unit::Update( uint32 p_time )
@ -433,7 +432,7 @@ void Unit::resetAttackTimer(WeaponAttackType type)
bool Unit::canReachWithAttack(Unit *pVictim) const
{
ASSERT(pVictim);
MANGOS_ASSERT(pVictim);
float reach = GetFloatValue(UNIT_FIELD_COMBATREACH);
if( reach <= 0.0f )
reach = 1.0f;
@ -850,10 +849,10 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
// last damage from non duel opponent or opponent controlled creature
if(duel_hasEnded)
{
ASSERT(pVictim->GetTypeId()==TYPEID_PLAYER);
MANGOS_ASSERT(pVictim->GetTypeId()==TYPEID_PLAYER);
Player *he = (Player*)pVictim;
ASSERT(he->duel);
MANGOS_ASSERT(he->duel);
he->duel->opponent->CombatStopWithPets(true);
he->CombatStopWithPets(true);
@ -1026,10 +1025,10 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
// last damage from duel opponent
if(duel_hasEnded)
{
ASSERT(pVictim->GetTypeId()==TYPEID_PLAYER);
MANGOS_ASSERT(pVictim->GetTypeId()==TYPEID_PLAYER);
Player *he = (Player*)pVictim;
ASSERT(he->duel);
MANGOS_ASSERT(he->duel);
he->SetHealth(1);
@ -3420,7 +3419,7 @@ void Unit::_UpdateAutoRepeatSpell()
void Unit::SetCurrentCastedSpell( Spell * pSpell )
{
ASSERT(pSpell); // NULL may be never passed here, use InterruptSpell or InterruptNonMeleeSpells
MANGOS_ASSERT(pSpell); // NULL may be never passed here, use InterruptSpell or InterruptNonMeleeSpells
CurrentSpellTypes CSpellType = pSpell->GetCurrentContainer();
@ -3491,7 +3490,7 @@ void Unit::SetCurrentCastedSpell( Spell * pSpell )
void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool sendAutoRepeatCancelToClient)
{
ASSERT(spellType < CURRENT_MAX_SPELL);
MANGOS_ASSERT(spellType < CURRENT_MAX_SPELL);
if (m_currentSpells[spellType] && (withDelayed || m_currentSpells[spellType]->getState() != SPELL_STATE_DELAYED) )
{
@ -4852,7 +4851,7 @@ GameObject* Unit::GetGameObject(uint32 spellId) const
void Unit::AddGameObject(GameObject* gameObj)
{
ASSERT(gameObj && gameObj->GetOwnerGUID()==0);
MANGOS_ASSERT(gameObj && gameObj->GetOwnerGUID()==0);
m_gameObj.push_back(gameObj);
gameObj->SetOwnerGUID(GetGUID());
@ -4868,7 +4867,7 @@ void Unit::AddGameObject(GameObject* gameObj)
void Unit::RemoveGameObject(GameObject* gameObj, bool del)
{
ASSERT(gameObj && gameObj->GetOwnerGUID()==GetGUID());
MANGOS_ASSERT(gameObj && gameObj->GetOwnerGUID()==GetGUID());
gameObj->SetOwnerGUID(0);
@ -8315,7 +8314,7 @@ void Unit::DeleteThreatList()
void Unit::TauntApply(Unit* taunter)
{
ASSERT(GetTypeId()== TYPEID_UNIT);
MANGOS_ASSERT(GetTypeId()== TYPEID_UNIT);
if(!taunter || (taunter->GetTypeId() == TYPEID_PLAYER && ((Player*)taunter)->isGameMaster()))
return;
@ -8338,7 +8337,7 @@ void Unit::TauntApply(Unit* taunter)
void Unit::TauntFadeOut(Unit *taunter)
{
ASSERT(GetTypeId()== TYPEID_UNIT);
MANGOS_ASSERT(GetTypeId()== TYPEID_UNIT);
if(!taunter || (taunter->GetTypeId() == TYPEID_PLAYER && ((Player*)taunter)->isGameMaster()))
return;
@ -8380,7 +8379,7 @@ bool Unit::SelectHostileTarget()
//next-victim-selection algorithm and evade mode are called
//threat list sorting etc.
ASSERT(GetTypeId()== TYPEID_UNIT);
MANGOS_ASSERT(GetTypeId()== TYPEID_UNIT);
if (!this->isAlive())
return false;

View file

@ -17,9 +17,9 @@
*/
#include "Common.h"
#include "UpdateData.h"
#include "ByteBuffer.h"
#include "WorldPacket.h"
#include "UpdateData.h"
#include "Log.h"
#include "Opcodes.h"
#include "World.h"
@ -104,7 +104,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size)
bool UpdateData::BuildPacket(WorldPacket *packet)
{
ASSERT(packet->empty()); // shouldn't happen
MANGOS_ASSERT(packet->empty()); // shouldn't happen
ByteBuffer buf(4 + (m_outOfRangeGUIDs.empty() ? 0 : 1 + 4 + 9 * m_outOfRangeGUIDs.size()) + m_data.wpos());

View file

@ -82,21 +82,21 @@ class UpdateMask
void operator &= ( const UpdateMask& mask )
{
ASSERT(mask.mCount <= mCount);
MANGOS_ASSERT(mask.mCount <= mCount);
for (uint32 i = 0; i < mBlocks; ++i)
mUpdateMask[i] &= mask.mUpdateMask[i];
}
void operator |= ( const UpdateMask& mask )
{
ASSERT(mask.mCount <= mCount);
MANGOS_ASSERT(mask.mCount <= mCount);
for (uint32 i = 0; i < mBlocks; ++i)
mUpdateMask[i] |= mask.mUpdateMask[i];
}
UpdateMask operator & ( const UpdateMask& mask ) const
{
ASSERT(mask.mCount <= mCount);
MANGOS_ASSERT(mask.mCount <= mCount);
UpdateMask newmask;
newmask = *this;
@ -107,7 +107,7 @@ class UpdateMask
UpdateMask operator | ( const UpdateMask& mask ) const
{
ASSERT(mask.mCount <= mCount);
MANGOS_ASSERT(mask.mCount <= mCount);
UpdateMask newmask;
newmask = *this;

View file

@ -19,6 +19,7 @@
#ifndef MANGOSSERVER_VEHICLE_H
#define MANGOSSERVER_VEHICLE_H
#include "Common.h"
#include "ObjectGuid.h"
#include "Creature.h"
#include "Unit.h"
@ -48,11 +49,11 @@ class Vehicle : public Creature
private:
void SaveToDB(uint32, uint8) // overwrited of Creature::SaveToDB - don't must be called
{
ASSERT(false);
MANGOS_ASSERT(false);
}
void DeleteFromDB() // overwrited of Creature::DeleteFromDB - don't must be called
{
ASSERT(false);
MANGOS_ASSERT(false);
}
};
#endif

View file

@ -16,10 +16,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "WaypointManager.h"
#include "Database/DatabaseEnv.h"
#include "GridDefines.h"
#include "Policies/SingletonImp.h"
#include "WaypointManager.h"
#include "ProgressBar.h"
#include "MapManager.h"
#include "ObjectMgr.h"
@ -125,7 +125,7 @@ void WaypointManager::Load()
WaypointPath &path = m_pathMap[id];
// the cleanup queries make sure the following is true
ASSERT(point >= 1 && point <= path.size());
MANGOS_ASSERT(point >= 1 && point <= path.size());
WaypointNode &node = path[point-1];
@ -298,7 +298,7 @@ void WaypointManager::Load()
WaypointPath &path = m_pathTemplateMap[entry];
// the cleanup queries make sure the following is true
ASSERT(point >= 1 && point <= path.size());
MANGOS_ASSERT(point >= 1 && point <= path.size());
WaypointNode &node = path[point-1];
@ -408,7 +408,7 @@ void WaypointManager::Cleanup()
sLog.outErrorDb("Table `creature_movement` was auto corrected for using points out of order (invalid or points missing)");
ASSERT(!(result = WorldDatabase.Query("SELECT 1 from creature_movement As T WHERE point <> (SELECT COUNT(*) FROM creature_movement WHERE id = T.id AND point <= T.point) LIMIT 1")));
MANGOS_ASSERT(!(result = WorldDatabase.Query("SELECT 1 from creature_movement As T WHERE point <> (SELECT COUNT(*) FROM creature_movement WHERE id = T.id AND point <= T.point) LIMIT 1")));
}
if (QueryResult *result = WorldDatabase.Query("SELECT 1 from creature_movement_template As T WHERE point <> (SELECT COUNT(*) FROM creature_movement_template WHERE entry = T.entry AND point <= T.point) LIMIT 1"))
@ -423,7 +423,7 @@ void WaypointManager::Cleanup()
sLog.outErrorDb("Table `creature_movement_template` was auto corrected for using points out of order (invalid or points missing)");
ASSERT(!(result = WorldDatabase.Query("SELECT 1 from creature_movement_template As T WHERE point <> (SELECT COUNT(*) FROM creature_movement_template WHERE entry = T.entry AND point <= T.point) LIMIT 1")));
MANGOS_ASSERT(!(result = WorldDatabase.Query("SELECT 1 from creature_movement_template As T WHERE point <> (SELECT COUNT(*) FROM creature_movement_template WHERE entry = T.entry AND point <= T.point) LIMIT 1")));
}
}

View file

@ -19,6 +19,7 @@
#ifndef MANGOS_WAYPOINTMANAGER_H
#define MANGOS_WAYPOINTMANAGER_H
#include "Common.h"
#include <vector>
#include <string>
#include "Utilities/UnorderedMapSet.h"

View file

@ -20,7 +20,7 @@
\ingroup world
*/
#include "Common.h"
#include "World.h"
#include "Database/DatabaseEnv.h"
#include "Config/Config.h"
#include "SystemConfig.h"
@ -33,7 +33,6 @@
#include "Vehicle.h"
#include "SkillExtraItems.h"
#include "SkillDiscovery.h"
#include "World.h"
#include "AccountMgr.h"
#include "AchievementMgr.h"
#include "AuctionHouseMgr.h"
@ -193,7 +192,7 @@ void World::AddSession(WorldSession* s)
void
World::AddSession_ (WorldSession* s)
{
ASSERT (s);
MANGOS_ASSERT (s);
//NOTE - Still there is race condition in WorldSession* being used in the Sockets

View file

@ -451,7 +451,7 @@ bool AuthSocket::_HandleLogonChallenge()
BigNumber gmod = g.ModExp(b, N);
B = ((v * 3) + gmod) % N;
ASSERT(gmod.GetNumBytes() <= 32);
MANGOS_ASSERT(gmod.GetNumBytes() <= 32);
BigNumber unk3;
unk3.SetRand(16 * 8);

View file

@ -49,7 +49,7 @@ void HMACSHA1::Finalize()
{
uint32 length = 0;
HMAC_Final(&m_ctx, (uint8*)m_digest, &length);
ASSERT(length == SHA_DIGEST_LENGTH);
MANGOS_ASSERT(length == SHA_DIGEST_LENGTH);
}
uint8 *HMACSHA1::ComputeHash(BigNumber *bn)

View file

@ -20,7 +20,6 @@
#define _BYTEBUFFER_H
#include "Common.h"
#include "Errors.h"
#include "Log.h"
#include "Utilities/ByteConverter.h"
@ -359,7 +358,7 @@ class ByteBuffer
if (!cnt)
return;
ASSERT(size() < 10000000);
MANGOS_ASSERT(size() < 10000000);
if (_storage.size() < _wpos + cnt)
_storage.resize(_wpos + cnt);

View file

@ -87,6 +87,7 @@
#include <sstream>
#include <algorithm>
#include "Errors.h"
#include "LockedQueue.h"
#include "Threading.h"

View file

@ -19,6 +19,8 @@
#if !defined(QUERYRESULT_H)
#define QUERYRESULT_H
#include "Errors.h"
class MANGOS_DLL_SPEC QueryResult
{
public:
@ -68,7 +70,7 @@ class MANGOS_DLL_SPEC QueryNamedResult
if(mFieldNames[idx] == name)
return idx;
}
ASSERT(false && "unknown field name");
MANGOS_ASSERT(false && "unknown field name");
return uint32(-1);
}

View file

@ -19,13 +19,14 @@
#ifndef DO_POSTGRESQL
#include "DatabaseEnv.h"
#include "Errors.h"
QueryResultMysql::QueryResultMysql(MYSQL_RES *result, MYSQL_FIELD *fields, uint64 rowCount, uint32 fieldCount) :
QueryResult(rowCount, fieldCount), mResult(result)
{
mCurrentRow = new Field[mFieldCount];
ASSERT(mCurrentRow);
MANGOS_ASSERT(mCurrentRow);
for (uint32 i = 0; i < mFieldCount; i++)
mCurrentRow[i].SetType(ConvertNativeType(fields[i].type));

View file

@ -68,9 +68,9 @@ if (!(CONDITION)) \
#endif
#ifdef MANGOS_DEBUG
# define ASSERT WPError
# define MANGOS_ASSERT WPError
#else
# define ASSERT WPError // Error even if in release mode.
# define MANGOS_ASSERT WPError // Error even if in release mode.
#endif
#endif

View file

@ -43,7 +43,7 @@ ThreadPriority::ThreadPriority()
pr_iter.next();
}
ASSERT (!_tmp.empty());
MANGOS_ASSERT (!_tmp.empty());
if(_tmp.size() >= MAXPRIORITYNUM)
{
@ -113,7 +113,7 @@ Thread::Thread(Runnable* instance) : m_task(instance), m_iThreadId(0), m_hThread
m_task->incReference();
bool _start = start();
ASSERT (_start);
MANGOS_ASSERT (_start);
}
Thread::~Thread()
@ -228,7 +228,7 @@ void Thread::setPriority(Priority type)
int _priority = m_TpEnum.getPriority(type);
int _ok = ACE_Thread::setprio(m_hThreadHandle, _priority);
//remove this ASSERT in case you don't want to know is thread priority change was successful or not
ASSERT (_ok == 0);
MANGOS_ASSERT (_ok == 0);
#endif
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10431"
#define REVISION_NR "10432"
#endif // __REVISION_NR_H__

View file

@ -155,7 +155,7 @@ namespace VMAP
{
float maxDist = (pos2 - pos1).magnitude();
// valid map coords should *never ever* produce float overflow, but this would produce NaNs too:
ASSERT(maxDist < std::numeric_limits<float>::max());
MANGOS_ASSERT(maxDist < std::numeric_limits<float>::max());
// prevent NaN values which can cause BIH intersection to enter infinite loop
if (maxDist < 1e-10f)
return true;
@ -177,7 +177,7 @@ namespace VMAP
bool result=false;
float maxDist = (pPos2 - pPos1).magnitude();
// valid map coords should *never ever* produce float overflow, but this would produce NaNs too:
ASSERT(maxDist < std::numeric_limits<float>::max());
MANGOS_ASSERT(maxDist < std::numeric_limits<float>::max());
// prevent NaN values which can cause BIH intersection to enter infinite loop
if (maxDist < 1e-10f)
{

View file

@ -36,7 +36,7 @@ namespace VMAP
#define ERROR_LOG(...) sLog.outError(__VA_ARGS__);
#else
#include <assert.h>
#define ASSERT(x) assert(x)
#define MANGOS_ASSERT(x) assert(x)
#define DEBUG_LOG(...) do{ printf(__VA_ARGS__); printf("\n"); } while(0)
#define DETAIL_LOG(...) do{ printf(__VA_ARGS__); printf("\n"); } while(0)
#define ERROR_LOG(...) do{ printf("ERROR:"); printf(__VA_ARGS__); printf("\n"); } while(0)