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:
silver1ce
2010-02-27 15:25:14 +02:00
parent 1815d19b85
commit fcaa318fb3
18 changed files with 290 additions and 475 deletions

View File

@@ -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));