Add possibility to ignore instant spells when checking if a spell is currently being casted. Fixes issue #2227
--HG-- branch : trunk
This commit is contained in:
@@ -3535,11 +3535,15 @@ void Unit::FinishSpell(CurrentSpellTypes spellType, bool ok /*= true*/)
|
||||
spell->finish(ok);
|
||||
}
|
||||
|
||||
bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skipAutorepeat, bool isAutoshoot) const
|
||||
bool Unit::IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled, bool skipAutorepeat, bool isAutoshoot, bool checkInstant) const
|
||||
{
|
||||
// We don't do loop here to explicitly show that melee spell is excluded.
|
||||
// Maybe later some special spells will be excluded too.
|
||||
|
||||
// if checkInstant then instant spells shouldn't count as being casted
|
||||
if (checkInstant && m_currentSpells[CURRENT_GENERIC_SPELL] && !m_currentSpells[CURRENT_GENERIC_SPELL]->GetCastTime())
|
||||
return false;
|
||||
|
||||
// generic spells are casted when they are not finished and not delayed
|
||||
if (m_currentSpells[CURRENT_GENERIC_SPELL] &&
|
||||
(m_currentSpells[CURRENT_GENERIC_SPELL]->getState() != SPELL_STATE_FINISHED) &&
|
||||
|
||||
@@ -1693,7 +1693,7 @@ class Unit : public WorldObject
|
||||
// set withDelayed to true to account delayed spells as casted
|
||||
// delayed+channeled spells are always accounted as casted
|
||||
// we can skip channeled or delayed checks using flags
|
||||
bool IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled = false, bool skipAutorepeat = false, bool isAutoshoot = false) const;
|
||||
bool IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled = false, bool skipAutorepeat = false, bool isAutoshoot = false, bool checkInstant = false) const;
|
||||
|
||||
// set withDelayed to true to interrupt delayed spells too
|
||||
// delayed+channeled spells are always interrupted
|
||||
|
||||
@@ -5581,10 +5581,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
// ..while they are casting
|
||||
if (target->IsNonMeleeSpellCasted(false, false, true))
|
||||
{
|
||||
if (target->IsNonMeleeSpellCasted(false, false, true, false, true))
|
||||
if (AuraEffect * aurEff = caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARRIOR, 2775, 0))
|
||||
{
|
||||
switch (aurEff->GetId())
|
||||
{
|
||||
// Unrelenting Assault, rank 1
|
||||
@@ -5596,8 +5594,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo
|
||||
target->CastSpell(target,64850,true,NULL,aurEff);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
switch(GetId())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user