Spells/Scripts: Allow OnEffectAbsorb to call PreventDefaultAction in AuraScripts

closes #6172

Signed-off-by: Subv <s.v.h21@hotmail.com>
This commit is contained in:
Subv
2012-04-12 05:52:20 -05:00
parent f7aadf51ee
commit 6cb8d607ce
2 changed files with 3 additions and 1 deletions

View File

@@ -2243,7 +2243,7 @@ void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellM
}
}
void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & /*defaultPrevented*/)
void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool& defaultPrevented)
{
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
@@ -2254,6 +2254,7 @@ void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication co
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
(*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount);
}
defaultPrevented = (*scritr)->_IsDefaultActionPrevented();
(*scritr)->_FinishScriptCall();
}
}

View File

@@ -787,6 +787,7 @@ void AuraScript::PreventDefaultAction()
case AURA_SCRIPT_HOOK_EFFECT_APPLY:
case AURA_SCRIPT_HOOK_EFFECT_REMOVE:
case AURA_SCRIPT_HOOK_EFFECT_PERIODIC:
case AURA_SCRIPT_HOOK_EFFECT_ABSORB:
m_defaultActionPrevented = true;
break;
default: