diff options
| author | Shocker <none@none> | 2010-08-26 20:40:18 +0300 |
|---|---|---|
| committer | Shocker <none@none> | 2010-08-26 20:40:18 +0300 |
| commit | 23d1267689eb25469334a4e706e57ebd81471c2f (patch) | |
| tree | c286eab1fda66428143f694286cc18cbf9952f41 /src/server/game/Entities | |
| parent | 30d31ca40a8d524d01d6472dff2fb96b53d92507 (diff) | |
Add possibility to ignore instant spells when checking if a spell is currently being casted. Fixes issue #2227
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Entities')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4cdbb5dc63b..4c7adefa56a 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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) && diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index ef4b6090421..f73b581f500 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -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 |
