Core/Spells: ported SpellInterruptFlags updates from master branch and corrected some own implementations based on these new results
This commit is contained in:
1 parent
b2ab210da9
commit
83298b52a2
8 files changed
+78
-66
No files matched your search
@@ -1427,10 +1427,6 @@ void Spell::EffectEnergize(SpellEffIndex effIndex)
|
||||
|
||||
Powers power = Powers(m_spellInfo->Effects[effIndex].MiscValue);
|
||||
|
||||
if (unitTarget->GetTypeId() == TYPEID_PLAYER && unitTarget->GetPowerType() != power && m_spellInfo->SpellFamilyName != SPELLFAMILY_POTION
|
||||
&& !m_spellInfo->HasAttribute(SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER))
|
||||
return;
|
||||
|
||||
if (unitTarget->GetMaxPower(power) == 0)
|
||||
return;
|
||||
|
||||
@@ -1490,10 +1486,6 @@ void Spell::EffectEnergizePct(SpellEffIndex effIndex)
|
||||
return;
|
||||
|
||||
Powers power = Powers(m_spellInfo->Effects[effIndex].MiscValue);
|
||||
|
||||
if (unitTarget->GetTypeId() == TYPEID_PLAYER && unitTarget->GetPowerType() != power && !m_spellInfo->HasAttribute(SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER))
|
||||
return;
|
||||
|
||||
uint32 maxPower = unitTarget->GetMaxPower(power);
|
||||
if (maxPower == 0)
|
||||
return;
|
||||
@@ -2888,9 +2880,7 @@ void Spell::EffectInterruptCast(SpellEffIndex effIndex)
|
||||
// check if we can interrupt spell
|
||||
if ((spell->getState() == SPELL_STATE_CASTING
|
||||
|| (spell->getState() == SPELL_STATE_PREPARING && spell->GetCastTime() > 0.0f))
|
||||
&& (curSpellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE || curSpellInfo->PreventionType == SPELL_PREVENTION_TYPE_UNK)
|
||||
&& ((i == CURRENT_GENERIC_SPELL && curSpellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_INTERRUPT)
|
||||
|| i == CURRENT_CHANNELED_SPELL))
|
||||
&& curSpellInfo->CanBeInterrupted(unitTarget))
|
||||
{
|
||||
if (m_originalCaster)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user