diff options
| author | Kandera <KanderaDev@gmail.com> | 2012-06-08 08:56:49 -0400 |
|---|---|---|
| committer | Kandera <KanderaDev@gmail.com> | 2012-06-08 08:56:56 -0400 |
| commit | 643b68926eb895c155df76e8534bca8155dbe87d (patch) | |
| tree | 0ff6966a8eadae59e1c2dea6f39784260ea72fc5 /src/server/game/Entities/Unit | |
| parent | 32aa983fe23ffc49ae0cf5322bae9f31beab5d47 (diff) | |
Core/Spells: codestyle and fix logic for adding unit state casting. (thx Moriquendu)
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e89e5df2a0c..d133a2b6a38 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2893,10 +2893,11 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); m_AutoRepeatFirstCast = true; } - if ((m_currentSpells[CURRENT_GENERIC_SPELL] && m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->CalcCastTime(this) > 0) && IsNonMeleeSpellCasted(false, false, true)) + if ((pSpell->m_spellInfo->CalcCastTime(this) > 0) && IsNonMeleeSpellCasted(false, false, true)) AddUnitState(UNIT_STATE_CASTING); - } break; + break; + } case CURRENT_CHANNELED_SPELL: { // channel spells always break generic non-delayed and any channeled spells @@ -2908,8 +2909,9 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75) InterruptSpell(CURRENT_AUTOREPEAT_SPELL); AddUnitState(UNIT_STATE_CASTING); - } break; + break; + } case CURRENT_AUTOREPEAT_SPELL: { // only Auto Shoot does not break anything @@ -2921,12 +2923,11 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell) } // special action: set first cast flag m_AutoRepeatFirstCast = true; - } break; + break; + } default: - { - // other spell types don't break anything now - } break; + break; // other spell types don't break anything now } // current spell (if it is still here) may be safely deleted now |
