mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[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:
parent
da44f2efe7
commit
91eb757e95
2 changed files with 15 additions and 4 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue