mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7339] Attempt lock spawn grid only for active non-pet creatures.
This commit is contained in:
parent
f35ffca03e
commit
b4dbeb3bc8
4 changed files with 20 additions and 20 deletions
|
|
@ -463,7 +463,8 @@ Map::Add(T *obj)
|
||||||
AddToGrid(obj,grid,cell);
|
AddToGrid(obj,grid,cell);
|
||||||
obj->AddToWorld();
|
obj->AddToWorld();
|
||||||
|
|
||||||
AddToActive(obj);
|
if(obj->isActiveObject())
|
||||||
|
AddToActive(obj);
|
||||||
|
|
||||||
DEBUG_LOG("Object %u enters grid[%u,%u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY());
|
DEBUG_LOG("Object %u enters grid[%u,%u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY());
|
||||||
|
|
||||||
|
|
@ -762,7 +763,8 @@ Map::Remove(T *obj, bool remove)
|
||||||
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
|
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
|
||||||
assert( grid != NULL );
|
assert( grid != NULL );
|
||||||
|
|
||||||
RemoveFromActive(obj);
|
if(obj->isActiveObject())
|
||||||
|
RemoveFromActive(obj);
|
||||||
|
|
||||||
obj->RemoveFromWorld();
|
obj->RemoveFromWorld();
|
||||||
RemoveFromGrid(obj,grid,cell);
|
RemoveFromGrid(obj,grid,cell);
|
||||||
|
|
@ -1623,7 +1625,7 @@ void Map::AddToActive( Creature* c )
|
||||||
AddToActiveHelper(c);
|
AddToActiveHelper(c);
|
||||||
|
|
||||||
// also not allow unloading spawn grid to prevent creating creature clone at load
|
// also not allow unloading spawn grid to prevent creating creature clone at load
|
||||||
if(c->GetDBTableGUIDLow())
|
if(!c->isPet() && c->GetDBTableGUIDLow())
|
||||||
{
|
{
|
||||||
float x,y,z;
|
float x,y,z;
|
||||||
c->GetRespawnCoord(x,y,z);
|
c->GetRespawnCoord(x,y,z);
|
||||||
|
|
@ -1644,7 +1646,7 @@ void Map::RemoveFromActive( Creature* c )
|
||||||
RemoveFromActiveHelper(c);
|
RemoveFromActiveHelper(c);
|
||||||
|
|
||||||
// also allow unloading spawn grid
|
// also allow unloading spawn grid
|
||||||
if(c->GetDBTableGUIDLow())
|
if(!c->isPet() && c->GetDBTableGUIDLow())
|
||||||
{
|
{
|
||||||
float x,y,z;
|
float x,y,z;
|
||||||
c->GetRespawnCoord(x,y,z);
|
c->GetRespawnCoord(x,y,z);
|
||||||
|
|
|
||||||
|
|
@ -358,26 +358,22 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
||||||
template<class T>
|
template<class T>
|
||||||
void AddToActiveHelper(T* obj)
|
void AddToActiveHelper(T* obj)
|
||||||
{
|
{
|
||||||
if(obj->isActiveObject())
|
m_activeNonPlayers.insert(obj);
|
||||||
m_activeNonPlayers.insert(obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void RemoveFromActiveHelper(T* obj)
|
void RemoveFromActiveHelper(T* obj)
|
||||||
{
|
{
|
||||||
if(obj->isActiveObject())
|
// Map::Update for active object in proccess
|
||||||
|
if(m_activeNonPlayersIter != m_activeNonPlayers.end())
|
||||||
{
|
{
|
||||||
// Map::Update for active object in proccess
|
ActiveNonPlayers::iterator itr = m_activeNonPlayers.find(obj);
|
||||||
if(m_activeNonPlayersIter != m_activeNonPlayers.end())
|
if(itr==m_activeNonPlayersIter)
|
||||||
{
|
++m_activeNonPlayersIter;
|
||||||
ActiveNonPlayers::iterator itr = m_activeNonPlayers.find(obj);
|
m_activeNonPlayers.erase(itr);
|
||||||
if(itr==m_activeNonPlayersIter)
|
|
||||||
++m_activeNonPlayersIter;
|
|
||||||
m_activeNonPlayers.erase(itr);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
m_activeNonPlayers.erase(obj);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
m_activeNonPlayers.erase(obj);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,8 @@ void LoadHelper(CellGuidSet const& guid_set, CellPair &cell, GridRefManager<T> &
|
||||||
|
|
||||||
addUnitState(obj,cell);
|
addUnitState(obj,cell);
|
||||||
obj->AddToWorld();
|
obj->AddToWorld();
|
||||||
map->AddToActive(obj);
|
if(obj->isActiveObject())
|
||||||
|
map->AddToActive(obj);
|
||||||
|
|
||||||
++count;
|
++count;
|
||||||
|
|
||||||
|
|
@ -152,7 +153,8 @@ void LoadHelper(CellCorpseSet const& cell_corpses, CellPair &cell, CorpseMapType
|
||||||
|
|
||||||
addUnitState(obj,cell);
|
addUnitState(obj,cell);
|
||||||
obj->AddToWorld();
|
obj->AddToWorld();
|
||||||
map->AddToActive(obj);
|
if(obj->isActiveObject())
|
||||||
|
map->AddToActive(obj);
|
||||||
|
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7338"
|
#define REVISION_NR "7339"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue