--HG--
branch : trunk
This commit is contained in:
megamage
2009-02-16 19:04:31 -06:00
19 changed files with 102 additions and 191 deletions

View File

@@ -4142,8 +4142,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
&& AurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()]!= SPELL_AURA_DUMMY)
//don't stop channeling of scripted spells (this is actually a hack)
{
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel(false);
channeled = true;
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel();
}
}
}
@@ -4180,14 +4179,6 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
delete Aur;
if(channeled)
{
//if target is not caster remove auras also on caster
if (caster!=this)
caster->RemoveAurasAtChanneledTarget (AurSpellInfo, caster);
RemoveAurasAtChanneledTarget (AurSpellInfo, caster);
}
if(statue)
statue->UnSummon();
@@ -7677,22 +7668,25 @@ void Unit::RemovePlayerFromVision(Player* plr)
plr->ClearFarsight();
}
void Unit::RemoveAllFromVision()
void Unit::RemoveBindSightAuras()
{
while (!m_sharedVision.empty())
/*while (!m_sharedVision.empty())
{
Player* plr = *m_sharedVision.begin();
m_sharedVision.erase(m_sharedVision.begin());
plr->ClearFarsight();
}
}*/
RemoveSpellsCausingAura(SPELL_AURA_BIND_SIGHT);
}
void Unit::UncharmSelf()
void Unit::RemoveCharmAuras()
{
if (!GetCharmer())
return;
RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM);
RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET);
RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS);
}
void Unit::UnsummonAllTotems()
@@ -9756,10 +9750,6 @@ void Unit::setDeathState(DeathState s)
RemoveAllAurasOnDeath();
UnsummonAllTotems();
// Possessed unit died, restore control to possessor
RemoveCharmedOrPossessedBy(NULL);
RemoveAllFromVision();
ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
// remove aurastates allowing special moves
@@ -10716,15 +10706,13 @@ void Unit::CleanupsBeforeDelete()
{
if(m_uint32Values) // only for fully created object
{
RemoveCharmedOrPossessedBy(NULL);
RemoveAllFromVision();
RemoveAllAuras();
InterruptNonMeleeSpells(true);
m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList
CombatStop();
ClearComboPointHolders();
DeleteThreatList();
getHostilRefManager().setOnlineOfflineState(false);
RemoveAllAuras();
RemoveAllGameObjects();
RemoveAllDynObjects();
GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
@@ -12384,14 +12372,14 @@ void Unit::SetCharmedOrPossessedBy(Unit* charmer, bool possess)
// Charmer stop charming
if(charmer->GetTypeId() == TYPEID_PLAYER)
((Player*)charmer)->StopCharmOrPossess();
((Player*)charmer)->StopCastingCharm();
// Charmed stop charming
if(GetTypeId() == TYPEID_PLAYER)
((Player*)this)->StopCharmOrPossess();
((Player*)this)->StopCastingCharm();
// Charmed stop being charmed
RemoveCharmedOrPossessedBy(NULL);
RemoveCharmAuras();
// Set charmed
charmer->SetCharm(this);