aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-16 19:04:31 -0600
committermegamage <none@none>2009-02-16 19:04:31 -0600
commit00ba699d6f391623db188cdcf183262369d38f31 (patch)
tree5fdc1441dc3f71a5de985c9c176e32aa51c7cdc4 /src/game/Unit.cpp
parent91e640d14e2332f0e1fc47780fc6278c02e47ee6 (diff)
parent5ded6c8df4920acbc14b6b21dd2d68a54e99011a (diff)
*Merge.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp36
1 files changed, 12 insertions, 24 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 74d474bf79e..b695afe7804 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -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);