mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Update visibility system
*visibility updates and ai relocations processed simultaneously for each grid *these operations now are not synchronized for different grids *some changes into structure of visibility notifiers --HG-- branch : trunk
This commit is contained in:
@@ -2374,8 +2374,7 @@ void Player::SetGameMaster(bool on)
|
||||
getHostilRefManager().setOnlineOfflineState(true);
|
||||
}
|
||||
|
||||
//ObjectAccessor::UpdateVisibilityForPlayer(this);
|
||||
SetToNotify();
|
||||
UpdateObjectVisibility();
|
||||
}
|
||||
|
||||
void Player::SetGMVisible(bool on)
|
||||
@@ -4446,8 +4445,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
|
||||
sOutdoorPvPMgr.HandlePlayerResurrects(this, newzone);
|
||||
|
||||
// update visibility
|
||||
//ObjectAccessor::UpdateVisibilityForPlayer(this);
|
||||
SetToNotify();
|
||||
UpdateObjectVisibility();
|
||||
|
||||
if(!applySickness)
|
||||
return;
|
||||
@@ -20123,6 +20121,27 @@ template void Player::UpdateVisibilityOf(Corpse* target, UpdateData& data
|
||||
template void Player::UpdateVisibilityOf(GameObject* target, UpdateData& data, std::set<Unit*>& visibleNow);
|
||||
template void Player::UpdateVisibilityOf(DynamicObject* target, UpdateData& data, std::set<Unit*>& visibleNow);
|
||||
|
||||
void Player::UpdateObjectVisibility(bool forced)
|
||||
{
|
||||
if (!forced)
|
||||
AddToNotify(NOTIFY_VISIBILITY_CHANGED);
|
||||
else
|
||||
{
|
||||
Unit::UpdateObjectVisibility(true);
|
||||
// updates visibility of all objects around point of view for current player
|
||||
Trinity::VisibleNotifier notifier(*this);
|
||||
m_seer->VisitNearbyObject(GetMap()->GetVisibilityDistance(), notifier);
|
||||
notifier.SendToSelf(); // send gathered data
|
||||
}
|
||||
}
|
||||
|
||||
void Player::UpdateVisibilityForPlayer()
|
||||
{
|
||||
Trinity::VisibleNotifier notifier(*this);
|
||||
m_seer->VisitNearbyObject(GetMap()->GetVisibilityDistance(), notifier);
|
||||
notifier.SendToSelf(); // send gathered data
|
||||
}
|
||||
|
||||
void Player::InitPrimaryProfessions()
|
||||
{
|
||||
SetFreePrimaryProfessions(sWorld.getConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL));
|
||||
|
||||
Reference in New Issue
Block a user