mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +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
|
|
@ -2229,7 +2229,7 @@ void Player::SetGameMaster(bool on)
|
|||
getHostilRefManager().setOnlineOfflineState(true);
|
||||
}
|
||||
|
||||
ObjectAccessor::UpdateVisibilityForPlayer(this);
|
||||
UpdateVisibilityForPlayer();
|
||||
}
|
||||
|
||||
void Player::SetGMVisible(bool on)
|
||||
|
|
@ -4142,7 +4142,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
|
|||
UpdateZone(newzone,newarea);
|
||||
|
||||
// update visibility
|
||||
ObjectAccessor::UpdateVisibilityForPlayer(this);
|
||||
UpdateVisibilityForPlayer();
|
||||
|
||||
if(!applySickness)
|
||||
return;
|
||||
|
|
@ -4195,7 +4195,7 @@ void Player::KillPlayer()
|
|||
// don't create corpse at this moment, player might be falling
|
||||
|
||||
// update visibility
|
||||
ObjectAccessor::UpdateObjectVisibility(this);
|
||||
UpdateObjectVisibility();
|
||||
}
|
||||
|
||||
void Player::CreateCorpse()
|
||||
|
|
@ -20616,5 +20616,27 @@ void Player::SetFarSightGUID( uint64 guid )
|
|||
SetUInt64Value(PLAYER_FARSIGHT, guid);
|
||||
|
||||
// need triggering load grids around new view point
|
||||
ObjectAccessor::UpdateVisibilityForPlayer(this);
|
||||
UpdateVisibilityForPlayer();
|
||||
}
|
||||
|
||||
void Player::UpdateVisibilityForPlayer()
|
||||
{
|
||||
WorldObject const* viewPoint = GetViewPoint();
|
||||
Map* m = GetMap();
|
||||
|
||||
CellPair p(MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
||||
m->UpdatePlayerVisibility(this, cell, p);
|
||||
|
||||
if (this != viewPoint)
|
||||
{
|
||||
CellPair pView(MaNGOS::ComputeCellPair(viewPoint->GetPositionX(), viewPoint->GetPositionY()));
|
||||
Cell cellView(pView);
|
||||
|
||||
m->UpdateObjectsVisibilityFor(this, cellView, pView);
|
||||
}
|
||||
else
|
||||
m->UpdateObjectsVisibilityFor(this, cell, p);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue