*Merge.
--HG-- branch : trunk
This commit is contained in:
+16
-4
@@ -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,12 +596,24 @@ 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;
|
||||
}
|
||||
|
||||
unit->m_Notified = true;
|
||||
|
||||
if(unit->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -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
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user