diff options
-rw-r--r-- | src/game/Map.cpp | 14 | ||||
-rw-r--r-- | src/game/NPCHandler.cpp | 6 | ||||
-rw-r--r-- | src/game/Player.cpp | 6 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 9 | ||||
-rw-r--r-- | src/game/Unit.cpp | 14 |
5 files changed, 34 insertions, 15 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 152a078868b..531f32e75e9 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -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()) diff --git a/src/game/NPCHandler.cpp b/src/game/NPCHandler.cpp index 59e88d669bc..04c31ff8f8d 100644 --- a/src/game/NPCHandler.cpp +++ b/src/game/NPCHandler.cpp @@ -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(); } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index cbd5003e12b..e1b24794cac 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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()); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 3d8ec73476b..d5e904c5479 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -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) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 24d1f3a3121..a4a08bb40f1 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -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) |