mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
*Massive cleanup redux.
--HG-- branch : trunk
This commit is contained in:
@@ -54,7 +54,7 @@ ObjectGridRespawnMover::Visit(CreatureMapType &m)
|
||||
// creature in unloading grid can have respawn point in another grid
|
||||
// if it will be unloaded then it will not respawn in original grid until unload/load original grid
|
||||
// move to respawn point to prevent this case. For player view in respawn grid this will be normal respawn.
|
||||
for(CreatureMapType::iterator iter = m.begin(); iter != m.end();)
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); )
|
||||
{
|
||||
Creature * c = iter->getSource();
|
||||
++iter;
|
||||
@@ -124,7 +124,7 @@ void AddObjectHelper(CellPair &cell, GridRefManager<T> &m, uint32 &count, Map* m
|
||||
template <class T>
|
||||
void LoadHelper(CellGuidSet const& guid_set, CellPair &cell, GridRefManager<T> &m, uint32 &count, Map* map)
|
||||
{
|
||||
for(CellGuidSet::const_iterator i_guid = guid_set.begin(); i_guid != guid_set.end(); ++i_guid)
|
||||
for (CellGuidSet::const_iterator i_guid = guid_set.begin(); i_guid != guid_set.end(); ++i_guid)
|
||||
{
|
||||
T* obj = new T;
|
||||
uint32 guid = *i_guid;
|
||||
@@ -144,7 +144,7 @@ void LoadHelper(CellCorpseSet const& cell_corpses, CellPair &cell, CorpseMapType
|
||||
if(cell_corpses.empty())
|
||||
return;
|
||||
|
||||
for(CellCorpseSet::const_iterator itr = cell_corpses.begin(); itr != cell_corpses.end(); ++itr)
|
||||
for (CellCorpseSet::const_iterator itr = cell_corpses.begin(); itr != cell_corpses.end(); ++itr)
|
||||
{
|
||||
if(itr->second != map->GetInstanceId())
|
||||
continue;
|
||||
@@ -224,10 +224,10 @@ void ObjectGridLoader::LoadN(void)
|
||||
{
|
||||
i_gameObjects = 0; i_creatures = 0; i_corpses = 0;
|
||||
i_cell.data.Part.cell_y = 0;
|
||||
for(unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
for (unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
{
|
||||
i_cell.data.Part.cell_x = x;
|
||||
for(unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
for (unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
{
|
||||
i_cell.data.Part.cell_y = y;
|
||||
GridLoader<Player, AllWorldObjectTypes, AllGridObjectTypes> loader;
|
||||
@@ -239,9 +239,9 @@ void ObjectGridLoader::LoadN(void)
|
||||
|
||||
void ObjectGridUnloader::MoveToRespawnN()
|
||||
{
|
||||
for(unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
for (unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
{
|
||||
for(unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
for (unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
{
|
||||
ObjectGridRespawnMover mover;
|
||||
mover.Move(i_grid(x, y));
|
||||
@@ -282,7 +282,7 @@ void
|
||||
ObjectGridStoper::Visit(CreatureMapType &m)
|
||||
{
|
||||
// stop any fights at grid de-activation and remove dynobjects created at cast by creatures
|
||||
for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
for (CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
iter->getSource()->RemoveAllDynObjects();
|
||||
if(iter->getSource()->isInCombat())
|
||||
@@ -304,7 +304,7 @@ ObjectGridCleaner::Stop(GridType &grid)
|
||||
void
|
||||
ObjectGridCleaner::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
for (CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
iter->getSource()->CleanupsBeforeDelete();
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ template<class T>
|
||||
void
|
||||
ObjectGridCleaner::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
for(typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
iter->getSource()->RemoveFromWorld();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user