*Fix the bug that players cannot see anything in instance.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-09 23:52:45 -05:00
parent eb219b08e2
commit 427a81649b
5 changed files with 13 additions and 7 deletions
+3 -4
View File
@@ -2126,12 +2126,11 @@ inline void Map::setNGrid(NGridType *grid, uint32 x, uint32 y)
i_grids[x][y] = grid; i_grids[x][y] = grid;
} }
void Map::DoDelayedMovesAndRemoves() //void Map::DoDelayedMovesAndRemoves()
{ //{
//MoveAllCreaturesInMoveList(); //MoveAllCreaturesInMoveList();
//RemoveAllObjectsInRemoveList(); //RemoveAllObjectsInRemoveList();
RelocationNotify(); //}
}
void Map::AddObjectToRemoveList(WorldObject *obj) void Map::AddObjectToRemoveList(WorldObject *obj)
{ {
+2 -2
View File
@@ -340,6 +340,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
virtual void MoveAllCreaturesInMoveList(); virtual void MoveAllCreaturesInMoveList();
virtual void RemoveAllObjectsInRemoveList(); virtual void RemoveAllObjectsInRemoveList();
virtual void RelocationNotify();
bool CreatureRespawnRelocation(Creature *c); // used only in MoveAllCreaturesInMoveList and ObjectGridUnloader bool CreatureRespawnRelocation(Creature *c); // used only in MoveAllCreaturesInMoveList and ObjectGridUnloader
@@ -373,7 +374,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
void AddObjectToRemoveList(WorldObject *obj); void AddObjectToRemoveList(WorldObject *obj);
void AddObjectToSwitchList(WorldObject *obj, bool on); void AddObjectToSwitchList(WorldObject *obj, bool on);
void DoDelayedMovesAndRemoves(); //void DoDelayedMovesAndRemoves();
virtual bool RemoveBones(uint64 guid, float x, float y); virtual bool RemoveBones(uint64 guid, float x, float y);
@@ -389,7 +390,6 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
void AddUnitToNotify(Unit* unit); void AddUnitToNotify(Unit* unit);
void RemoveUnitFromNotify(int32 slot); void RemoveUnitFromNotify(int32 slot);
void RelocationNotify();
void SendToPlayers(WorldPacket const* data) const; void SendToPlayers(WorldPacket const* data) const;
+6
View File
@@ -77,6 +77,12 @@ void MapInstanced::RemoveAllObjectsInRemoveList()
Map::RemoveAllObjectsInRemoveList(); Map::RemoveAllObjectsInRemoveList();
} }
void MapInstanced::RelocationNotify()
{
for (InstancedMaps::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); ++i)
i->second->RelocationNotify();
}
bool MapInstanced::RemoveBones(uint64 guid, float x, float y) bool MapInstanced::RemoveBones(uint64 guid, float x, float y)
{ {
bool remove_result = false; bool remove_result = false;
+1
View File
@@ -37,6 +37,7 @@ class TRINITY_DLL_DECL MapInstanced : public Map
void Update(const uint32&); void Update(const uint32&);
void MoveAllCreaturesInMoveList(); void MoveAllCreaturesInMoveList();
void RemoveAllObjectsInRemoveList(); void RemoveAllObjectsInRemoveList();
void RelocationNotify();
bool RemoveBones(uint64 guid, float x, float y); bool RemoveBones(uint64 guid, float x, float y);
void UnloadAll(); void UnloadAll();
bool CanEnter(Player* player); bool CanEnter(Player* player);
+1 -1
View File
@@ -270,7 +270,7 @@ MapManager::Update(uint32 diff)
void MapManager::DoDelayedMovesAndRemoves() void MapManager::DoDelayedMovesAndRemoves()
{ {
for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter) for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
iter->second->DoDelayedMovesAndRemoves(); iter->second->RelocationNotify();
} }
bool MapManager::ExistMapAndVMap(uint32 mapid, float x,float y) bool MapManager::ExistMapAndVMap(uint32 mapid, float x,float y)