From 6a0677fd03861ca11c619593df05abd07cda25af Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 27 Mar 2009 09:06:26 -0600 Subject: *Fix the bug of visibility. --HG-- branch : trunk --- src/game/Map.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src/game/Map.cpp') diff --git a/src/game/Map.cpp b/src/game/Map.cpp index c1cd4da191a..fb7664616dc 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -471,6 +471,7 @@ bool Map::Add(Player *player) player->m_IsInNotifyList = false; player->m_Notified = false; + player->m_clientGUIDs.clear(); AddNotifier(player); return true; @@ -616,24 +617,12 @@ void Map::RelocationNotify() for(std::vector::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter) { Unit *unit = ObjectAccessor::GetObjectInWorld(*iter, (Unit*)NULL); - if(!unit || unit->GetMapId() != GetId()) + if(!unit || !unit->IsInWorld() || unit->GetMapId() != GetId()) { *iter = 0; continue; } - if(!unit->IsInWorld()) - { - //other objs are done during remove - if(unit->GetTypeId() == TYPEID_PLAYER) - { - Trinity::VisibleChangesNotifier notifier(*unit); - VisitWorld(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier); - } - *iter = 0; - continue; - } - unit->m_Notified = true; if(unit->GetTypeId() == TYPEID_PLAYER) @@ -812,8 +801,6 @@ void Map::Update(const uint32 &t_diff) void Map::Remove(Player *player, bool remove) { - AddUnitToNotify(player); - // this may be called during Map::Update // after decrement+unlink, ++m_mapRefIter will continue correctly // when the first element of the list is being removed @@ -850,6 +837,7 @@ void Map::Remove(Player *player, bool remove) RemoveFromGrid(player,grid,cell); SendRemoveTransports(player); + UpdateObjectVisibility(player,cell,p); if( remove ) DeleteFromWorld(player); -- cgit v1.2.3