diff options
author | megamage <none@none> | 2009-02-15 17:33:36 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-15 17:33:36 -0600 |
commit | bb75ff7b79e89dac82f3ee1c740eb6079c7ec43b (patch) | |
tree | a48ea1fe70e395573e7ca4be4058fe894bbc2bdf /src/game/Unit.cpp | |
parent | 058b7c32e40332a620d8e294b4defba81e14dfc0 (diff) |
*Cleanup of charm/farsight code. Hope this can fix some crash bugs.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e7ff4e3ec62..6bb085eca11 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8480,22 +8480,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() @@ -10298,10 +10301,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 @@ -11152,15 +11151,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. @@ -12982,14 +12979,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); |