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:
Shocker committed 2010-08-26 20:40:18 +03:00
1 parent 30d31ca40a
commit 23d1267689
3 files changed
+7 -7

No files matched your search

+5 -1
View File
@@ -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) &&