Fix crash in AuraEffect::HandleShapeshiftBoosts

Add check to Spell::EffectSanctuary before casting
(ensuring all appearances of "(Player *)" (whitespace incl.) are correct)

--HG--
branch : trunk
This commit is contained in:
thenecromancer
2010-03-08 17:20:25 +01:00
parent 887583bf09
commit 2cc15aee31
2 changed files with 9 additions and 4 deletions

View File

@@ -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();

View File

@@ -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