*Fix visibility update bug.
--HG-- branch : trunk
This commit is contained in:
@@ -99,6 +99,9 @@ PlayerVisibilityNotifier::Notify()
|
|||||||
for(std::set<WorldObject*>::const_iterator vItr = i_visibleNow.begin(); vItr != i_visibleNow.end(); ++vItr)
|
for(std::set<WorldObject*>::const_iterator vItr = i_visibleNow.begin(); vItr != i_visibleNow.end(); ++vItr)
|
||||||
if((*vItr)!=&i_player && (*vItr)->isType(TYPEMASK_UNIT))
|
if((*vItr)!=&i_player && (*vItr)->isType(TYPEMASK_UNIT))
|
||||||
i_player.SendInitialVisiblePackets((Unit*)(*vItr));
|
i_player.SendInitialVisiblePackets((Unit*)(*vItr));
|
||||||
|
|
||||||
|
if(i_visibleNow.size() >= 30)
|
||||||
|
i_player.SetToNotify();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
+5
-6
@@ -615,7 +615,6 @@ void Map::RelocationNotify()
|
|||||||
if(Unit *unit = ObjectAccessor::GetObjectInWorld(*iter, (Unit*)NULL))
|
if(Unit *unit = ObjectAccessor::GetObjectInWorld(*iter, (Unit*)NULL))
|
||||||
{
|
{
|
||||||
i_unitsToNotify.push_back(unit);
|
i_unitsToNotify.push_back(unit);
|
||||||
unit->m_Notified = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i_unitsToNotifyBacklog.clear();
|
i_unitsToNotifyBacklog.clear();
|
||||||
@@ -624,11 +623,10 @@ void Map::RelocationNotify()
|
|||||||
for(std::vector<Unit*>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
|
for(std::vector<Unit*>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
|
||||||
{
|
{
|
||||||
Unit *unit = *iter;
|
Unit *unit = *iter;
|
||||||
unit->m_IsInNotifyList = false;
|
|
||||||
|
|
||||||
if(!unit->IsInWorld() || unit->GetMapId() != GetId())
|
if(!unit->IsInWorld() || unit->GetMapId() != GetId())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
unit->m_IsInNotifyList = false;
|
||||||
unit->m_Notified = true;
|
unit->m_Notified = true;
|
||||||
|
|
||||||
if(unit->GetTypeId() == TYPEID_PLAYER)
|
if(unit->GetTypeId() == TYPEID_PLAYER)
|
||||||
@@ -643,6 +641,10 @@ void Map::RelocationNotify()
|
|||||||
VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
|
VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for(std::vector<Unit*>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
|
||||||
|
{
|
||||||
|
(*iter)->m_Notified = false;
|
||||||
|
}
|
||||||
i_unitsToNotify.clear();
|
i_unitsToNotify.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -656,10 +658,7 @@ void Map::AddUnitToNotify(Unit* u)
|
|||||||
if(i_lock)
|
if(i_lock)
|
||||||
i_unitsToNotifyBacklog.push_back(u->GetGUID());
|
i_unitsToNotifyBacklog.push_back(u->GetGUID());
|
||||||
else
|
else
|
||||||
{
|
|
||||||
i_unitsToNotify.push_back(u);
|
i_unitsToNotify.push_back(u);
|
||||||
u->m_Notified = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Map::Update(const uint32 &t_diff)
|
void Map::Update(const uint32 &t_diff)
|
||||||
|
|||||||
@@ -17828,8 +17828,6 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set<WorldObjec
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
SetToNotify();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*template<>
|
/*template<>
|
||||||
|
|||||||
Reference in New Issue
Block a user