[8489] Fixed player visibility update in case view point different from player itself.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
SilverIce 2009-09-11 22:23:52 +04:00 committed by VladimirMangos
parent da44f2efe7
commit 91eb757e95
2 changed files with 15 additions and 4 deletions

View file

@ -451,12 +451,23 @@ ObjectAccessor::UpdateObjectVisibility(WorldObject *obj)
void ObjectAccessor::UpdateVisibilityForPlayer( Player* player ) void ObjectAccessor::UpdateVisibilityForPlayer( Player* player )
{ {
CellPair p = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY()); WorldObject const* viewPoint = player->GetViewPoint();
Cell cell(p);
Map* m = player->GetMap(); Map* m = player->GetMap();
CellPair p(MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY()));
Cell cell(p);
m->UpdatePlayerVisibility(player, 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 /// Define the static member of HashMapHolder

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "8488" #define REVISION_NR "8489"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__