aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/Map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
-rw-r--r--src/server/game/Maps/Map.cpp56
1 files changed, 28 insertions, 28 deletions
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;
}