diff options
| author | megamage <none@none> | 2009-03-26 21:54:14 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2009-03-26 21:54:14 -0600 |
| commit | e9bdfa4d02cc5b88e26270290d1f8ad7785d5f17 (patch) | |
| tree | 65893bce609108ca7b85d760f7592c96eda2f7ac /src | |
| parent | cd7376c7063dc88ead544e278f01870bdd99a073 (diff) | |
| parent | 52a5c5e8e3534d4c5d33076ab321dc654d77fa85 (diff) | |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/Map.cpp | 20 | ||||
| -rw-r--r-- | src/game/Player.cpp | 11 | ||||
| -rw-r--r-- | src/game/SpellAuras.cpp | 4 | ||||
| -rw-r--r-- | src/game/Unit.cpp | 2 |
4 files changed, 19 insertions, 18 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp index fb649602c75..b82c4127d94 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -449,6 +449,8 @@ bool Map::Add(Player *player) SendInitSelf(player); SendInitTransports(player); + player->m_IsInNotifyList = false; + player->m_Notified = false; AddNotifier(player); return true; @@ -594,8 +596,20 @@ void Map::RelocationNotify() for(std::vector<uint64>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter) { Unit *unit = ObjectAccessor::GetObjectInWorld(*iter, (Unit*)NULL); - if(!unit || !unit->IsInWorld() || !unit->GetMapId() == GetId()) + if(!unit || unit->GetMapId() != GetId()) + { + *iter = 0; + continue; + } + + if(!unit->IsInWorld()) { + //other objs are done during remove + if(unit->GetTypeId() == TYPEID_PLAYER) + { + Trinity::VisibleChangesNotifier notifier(*unit); + VisitWorld(unit->GetPositionX(), unit->GetPositionY(), World::GetMaxVisibleDistance(), notifier); + } *iter = 0; continue; } @@ -758,9 +772,7 @@ void Map::Update(const uint32 &t_diff) void Map::Remove(Player *player, bool remove) { - player->DestroyForNearbyPlayers(); - player->m_IsInNotifyList = false; - player->m_Notified = false; + AddUnitToNotify(player); // this may be called during Map::Update // after decrement+unlink, ++m_mapRefIter will continue correctly diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 2f1d21a8b56..20fc71d08bb 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1756,17 +1756,6 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati ResetContestedPvP(); - /*DestroyForNearbyPlayers(); - { - UpdateData data; - for(ClientGUIDs::iterator i = m_clientGUIDs.begin(); i != m_clientGUIDs.end(); ++i) - data.AddOutOfRangeGUID(*i); - WorldPacket packet; - data.BuildPacket(&packet); - GetSession()->SendPacket(&packet); - }*/ - m_clientGUIDs.clear(); - // remove player from battleground on far teleport (when changing maps) if(BattleGround const* bg = GetBattleGround()) { diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 4b1dd4f50ae..54c05ce10a5 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -902,7 +902,7 @@ void Aura::_AddAura() if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(id + SPELL_LINK_AURA)) for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) if(*itr < 0) - m_target->ApplySpellImmune(id, IMMUNITY_ID, *itr, m_target); + m_target->ApplySpellImmune(id, IMMUNITY_ID, -(*itr), m_target); else if(Unit* caster = GetCaster()) m_target->AddAura(*itr, m_target); } @@ -1043,7 +1043,7 @@ void Aura::_RemoveAura() if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(id + SPELL_LINK_AURA)) for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) if(*itr < 0) - m_target->ApplySpellImmune(id, IMMUNITY_ID, *itr, false); + m_target->ApplySpellImmune(id, IMMUNITY_ID, -(*itr), false); else m_target->RemoveAurasDueToSpell(*itr); } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index deece9e3864..100fa5231db 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4393,7 +4393,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) // Statue unsummoned at aura remove Totem* statue = NULL; bool channeled = false; - if(Aur->GetAuraDuration() && IsChanneledSpell(AurSpellInfo)) + if(Aur->GetAuraDuration() && !Aur->IsPersistent() && IsChanneledSpell(AurSpellInfo)) { if(!caster) // can be already located for IsSingleTargetSpell case caster = Aur->GetCaster(); |
