diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index 79b9d9c02..ee8943781 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -451,12 +451,23 @@ ObjectAccessor::UpdateObjectVisibility(WorldObject *obj) void ObjectAccessor::UpdateVisibilityForPlayer( Player* player ) { - CellPair p = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY()); - Cell cell(p); + 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); - m->UpdateObjectsVisibilityFor(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 diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index d3393c41a..a74f8c448 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8488" + #define REVISION_NR "8489" #endif // __REVISION_NR_H__