aboutsummaryrefslogtreecommitdiff
path: root/src/game/ObjectAccessor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/ObjectAccessor.cpp')
-rw-r--r--src/game/ObjectAccessor.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp
index aab742aed65..8bc0e385f6f 100644
--- a/src/game/ObjectAccessor.cpp
+++ b/src/game/ObjectAccessor.cpp
@@ -480,12 +480,22 @@ ObjectAccessor::UpdateObjectVisibility(WorldObject *obj)
/*void ObjectAccessor::UpdateVisibilityForPlayer( Player* player )
{
+ WorldObject const* viewPoint = player->GetViewPoint();
+ Map* m = player->GetMap();
+
CellPair p = Trinity::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
Cell cell(p);
- Map* m = player->GetMap();
m->UpdatePlayerVisibility(player, cell, p);
- m->UpdateObjectsVisibilityFor(player, cell, p);
+ if (player!=viewPoint)
+ {
+ CellPair pView(Trinity::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