*Update visibility only once per update.
--HG-- branch : trunk
This commit is contained in:
+8
-6
@@ -476,8 +476,8 @@ bool Map::Add(Player *player)
|
||||
SendInitSelf(player);
|
||||
SendInitTransports(player);
|
||||
|
||||
UpdatePlayerVisibility(player,cell,p);
|
||||
UpdateObjectsVisibilityFor(player,cell,p);
|
||||
//UpdatePlayerVisibility(player,cell,p);
|
||||
//UpdateObjectsVisibilityFor(player,cell,p);
|
||||
|
||||
//AddNotifier(player,cell,p);
|
||||
AddUnitToNotify(player);
|
||||
@@ -664,14 +664,16 @@ void Map::Update(const uint32 &t_diff)
|
||||
unit->m_Notified = true;
|
||||
if(!unit->IsInWorld())
|
||||
continue;
|
||||
//CellPair val = Trinity::ComputeCellPair(unit->GetPositionX(), unit->GetPositionY());
|
||||
//Cell cell(val);
|
||||
CellPair val = Trinity::ComputeCellPair(unit->GetPositionX(), unit->GetPositionY());
|
||||
Cell cell(val);
|
||||
//if(unit->GetTypeId() == TYPEID_PLAYER)
|
||||
// PlayerRelocationNotify((Player*)unit, cell, val);
|
||||
//else
|
||||
// CreatureRelocationNotify((Creature*)unit, cell, val);
|
||||
if(unit->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
UpdatePlayerVisibility((Player*)unit, cell, val);
|
||||
UpdateObjectsVisibilityFor((Player*)unit, cell, val);
|
||||
Trinity::PlayerRelocationNotifier notifier(*((Player*)unit));
|
||||
VisitAll(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier);
|
||||
}
|
||||
@@ -891,8 +893,8 @@ Map::PlayerRelocation(Player *player, float x, float y, float z, float orientati
|
||||
}
|
||||
|
||||
// if move then update what player see and who seen
|
||||
UpdatePlayerVisibility(player,new_cell,new_val);
|
||||
UpdateObjectsVisibilityFor(player,new_cell,new_val);
|
||||
//UpdatePlayerVisibility(player,new_cell,new_val);
|
||||
//UpdateObjectsVisibilityFor(player,new_cell,new_val);
|
||||
|
||||
// also update what possessing player sees
|
||||
if(player->isPossessedByPlayer())
|
||||
|
||||
@@ -399,11 +399,13 @@ void WorldSession::SendSpiritResurrect()
|
||||
_player->TeleportTo(corpseGrave->map_id, corpseGrave->x, corpseGrave->y, corpseGrave->z, _player->GetOrientation());
|
||||
// or update at original position
|
||||
else
|
||||
ObjectAccessor::UpdateVisibilityForPlayer(_player);
|
||||
//ObjectAccessor::UpdateVisibilityForPlayer(_player);
|
||||
_player->SetToNotify();
|
||||
}
|
||||
// or update at original position
|
||||
else
|
||||
ObjectAccessor::UpdateVisibilityForPlayer(_player);
|
||||
//ObjectAccessor::UpdateVisibilityForPlayer(_player);
|
||||
_player->SetToNotify();
|
||||
|
||||
_player->SaveToDB();
|
||||
}
|
||||
|
||||
+4
-2
@@ -2070,7 +2070,8 @@ void Player::SetGameMaster(bool on)
|
||||
getHostilRefManager().setOnlineOfflineState(true);
|
||||
}
|
||||
|
||||
ObjectAccessor::UpdateVisibilityForPlayer(this);
|
||||
//ObjectAccessor::UpdateVisibilityForPlayer(this);
|
||||
SetToNotify();
|
||||
}
|
||||
|
||||
void Player::SetGMVisible(bool on)
|
||||
@@ -3851,7 +3852,8 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
|
||||
}
|
||||
|
||||
// update visibility
|
||||
ObjectAccessor::UpdateVisibilityForPlayer(this);
|
||||
//ObjectAccessor::UpdateVisibilityForPlayer(this);
|
||||
SetToNotify();
|
||||
|
||||
// some items limited to specific map
|
||||
DestroyZoneLimitedItem( true, GetZoneId());
|
||||
|
||||
@@ -3066,9 +3066,9 @@ void Aura::HandleFeignDeath(bool apply, bool Real)
|
||||
*/
|
||||
|
||||
std::list<Unit*> targets;
|
||||
Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(m_target, m_target, 100);
|
||||
Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(m_target, m_target, World::GetMaxVisibleDistance());
|
||||
Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(targets, u_check);
|
||||
m_target->VisitNearbyObject(100, searcher);
|
||||
m_target->VisitNearbyObject(World::GetMaxVisibleDistance(), searcher);
|
||||
for(std::list<Unit*>::iterator iter = targets.begin(); iter != targets.end(); ++iter)
|
||||
{
|
||||
if(!(*iter)->hasUnitState(UNIT_STAT_CASTING))
|
||||
@@ -3187,7 +3187,7 @@ void Aura::HandleModStealth(bool apply, bool Real)
|
||||
if(m_target->GetVisibility()!=VISIBILITY_OFF)
|
||||
{
|
||||
//m_target->SetVisibility(VISIBILITY_GROUP_NO_DETECT);
|
||||
m_target->SetVisibility(VISIBILITY_OFF);
|
||||
//m_target->SetVisibility(VISIBILITY_OFF);
|
||||
m_target->SetVisibility(VISIBILITY_GROUP_STEALTH);
|
||||
}
|
||||
|
||||
@@ -3320,7 +3320,8 @@ void Aura::HandleInvisibilityDetect(bool apply, bool Real)
|
||||
m_target->m_detectInvisibilityMask |= (1 << m_modifier.m_miscvalue);
|
||||
}
|
||||
if(Real && m_target->GetTypeId()==TYPEID_PLAYER)
|
||||
ObjectAccessor::UpdateVisibilityForPlayer((Player*)m_target);
|
||||
//ObjectAccessor::UpdateVisibilityForPlayer((Player*)m_target);
|
||||
m_target->SetToNotify();
|
||||
}
|
||||
|
||||
void Aura::HandleAuraModRoot(bool apply, bool Real)
|
||||
|
||||
+13
-1
@@ -9959,14 +9959,26 @@ void Unit::SetVisibility(UnitVisibility x)
|
||||
m_Visibility = x;
|
||||
|
||||
if(IsInWorld())
|
||||
SetToNotify();
|
||||
|
||||
if(x == VISIBILITY_GROUP_STEALTH)
|
||||
{
|
||||
std::list<Unit*> targets;
|
||||
Trinity::AnyUnitInObjectRangeCheck check(this, World::GetMaxVisibleDistance());
|
||||
Trinity::UnitListSearcher<Trinity::AnyUnitInObjectRangeCheck> searcher(targets, check);
|
||||
VisitNearbyWorldObject(World::GetMaxVisibleDistance(), searcher);
|
||||
for(std::list<Unit*>::iterator iter = targets.begin(); iter != targets.end(); ++iter)
|
||||
if((*iter)->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)(*iter))->m_clientGUIDs.erase(GetGUID());
|
||||
}
|
||||
/*{
|
||||
Map *m = GetMap();
|
||||
|
||||
if(GetTypeId()==TYPEID_PLAYER)
|
||||
m->PlayerRelocation((Player*)this,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
|
||||
else
|
||||
m->CreatureRelocation((Creature*)this,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
|
||||
|
||||
Reference in New Issue
Block a user