diff options
author | thenecromancer <none@none> | 2010-03-08 17:20:25 +0100 |
---|---|---|
committer | thenecromancer <none@none> | 2010-03-08 17:20:25 +0100 |
commit | 2cc15aee31e36d408114ab2d90efe05f92c8041f (patch) | |
tree | ab1ce96717a5ca19e6c12f076172861190e956f5 /src | |
parent | 887583bf092bf3956db493c259d7c5c14c2b5eff (diff) |
Fix crash in AuraEffect::HandleShapeshiftBoosts
Add check to Spell::EffectSanctuary before casting
(ensuring all appearances of "(Player *)" (whitespace incl.) are correct)
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellAuraEffects.cpp | 9 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/game/SpellAuraEffects.cpp b/src/game/SpellAuraEffects.cpp index 0c21a509677..7d2f1b343e0 100644 --- a/src/game/SpellAuraEffects.cpp +++ b/src/game/SpellAuraEffects.cpp @@ -2509,10 +2509,13 @@ void AuraEffect::HandleShapeshiftBoosts(Unit * target, bool apply) const target->RemoveAurasDueToSpell(spellId2); // Improved Barkskin - apply/remove armor bonus due to shapeshift - if (target->ToPlayer()->HasSpell(63410) || target->ToPlayer()->HasSpell(63411)) + if (Player *pl=target->ToPlayer()) { - target->RemoveAurasDueToSpell(66530); - target->CastSpell(target,66530,true); + if (pl->HasSpell(63410) || pl->HasSpell(63411)) + { + target->RemoveAurasDueToSpell(66530); + target->CastSpell(target,66530,true); + } } Unit::AuraApplicationMap& tAuras = target->GetAppliedAuras(); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index ce10e276b55..523ca6691ab 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -6148,7 +6148,9 @@ void Spell::EffectSanctuary(uint32 /*i*/) unitTarget->CombatStop(); unitTarget->getHostilRefManager().deleteReferences(); // stop all fighting // Vanish allows to remove all threat and cast regular stealth so other spells can be used - if(m_spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_VANISH)) + if(m_caster->GetTypeId() == TYPEID_PLAYER + && m_spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE + && (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_VANISH)) { ((Player *)m_caster)->RemoveAurasByType(SPELL_AURA_MOD_ROOT); // Overkill |