mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 22:37:02 +00:00
Move visibility update functions to more appropriate classes.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
4041121fd8
commit
63897d56d7
10 changed files with 47 additions and 44 deletions
|
|
@ -442,36 +442,6 @@ ObjectAccessor::WorldObjectChangeAccumulator::Visit(PlayerMapType &m)
|
|||
ObjectAccessor::_buildPacket(iter->getSource(), &i_object, i_updateDatas);
|
||||
}
|
||||
|
||||
void
|
||||
ObjectAccessor::UpdateObjectVisibility(WorldObject *obj)
|
||||
{
|
||||
CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
|
||||
Cell cell(p);
|
||||
|
||||
obj->GetMap()->UpdateObjectVisibility(obj, cell, p);
|
||||
}
|
||||
|
||||
void ObjectAccessor::UpdateVisibilityForPlayer( Player* player )
|
||||
{
|
||||
WorldObject const* viewPoint = player->GetViewPoint();
|
||||
Map* m = player->GetMap();
|
||||
|
||||
CellPair p(MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
||||
m->UpdatePlayerVisibility(player, cell, p);
|
||||
|
||||
if (player!=viewPoint)
|
||||
{
|
||||
CellPair pView(MaNGOS::ComputeCellPair(viewPoint->GetPositionX(), viewPoint->GetPositionY()));
|
||||
Cell cellView(pView);
|
||||
|
||||
m->UpdateObjectsVisibilityFor(player, cellView, pView);
|
||||
}
|
||||
else
|
||||
m->UpdateObjectsVisibilityFor(player, cell, p);
|
||||
}
|
||||
|
||||
/// Define the static member of HashMapHolder
|
||||
|
||||
template <class T> UNORDERED_MAP< uint64, T* > HashMapHolder<T>::m_objectMap;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue