From e583f543a2f76a9814c1e8189a35e7d132979d6b Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Fri, 25 Dec 2009 21:03:37 +0300 Subject: [PATCH] [9066] Small cleanups in spell code. Mostly avoid unclear "lost" break case --- src/game/Spell.cpp | 15 ++++++++++----- src/game/Unit.cpp | 9 ++++----- src/shared/revision_nr.h | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 2308ddd00..3f24bbd94 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -692,24 +692,29 @@ void Spell::prepareDataForTriggerSystem() else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000010000000000)) m_canTrigger = true; break; - case SPELLFAMILY_WARLOCK: // For Hellfire Effect / Rain of Fire / Seed of Corruption triggers need do it + case SPELLFAMILY_WARLOCK: + // For Hellfire Effect / Rain of Fire / Seed of Corruption triggers need do it if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000800000000060)) m_canTrigger = true; break; - case SPELLFAMILY_PRIEST: // For Penance,Mind Sear,Mind Flay heal/damage triggers need do it + case SPELLFAMILY_PRIEST: + // For Penance,Mind Sear,Mind Flay heal/damage triggers need do it if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0001800000800000) || (m_spellInfo->SpellFamilyFlags2 & 0x00000040)) m_canTrigger = true; break; - case SPELLFAMILY_ROGUE: // For poisons need do it + case SPELLFAMILY_ROGUE: + // For poisons need do it if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x000000101001E000)) m_canTrigger = true; break; - case SPELLFAMILY_HUNTER: // Hunter Rapid Killing/Explosive Trap Effect/Immolation Trap Effect/Frost Trap Aura/Snake Trap Effect/Explosive Shot + case SPELLFAMILY_HUNTER: + // Hunter Rapid Killing/Explosive Trap Effect/Immolation Trap Effect/Frost Trap Aura/Snake Trap Effect/Explosive Shot if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x0100200000000214)) || m_spellInfo->SpellFamilyFlags2 & 0x200) m_canTrigger = true; break; - case SPELLFAMILY_PALADIN: // For Judgements (all) / Holy Shock triggers need do it + case SPELLFAMILY_PALADIN: + // For Judgements (all) / Holy Shock triggers need do it if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0001000900B80400)) m_canTrigger = true; break; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 15cbf8ce4..834fadb41 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -9069,19 +9069,18 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM break; } case SPELL_DAMAGE_CLASS_MELEE: + case SPELL_DAMAGE_CLASS_RANGED: { // Judgement of Command proc always crits on stunned target - if(spellProto->SpellFamilyName == SPELLFAMILY_PALADIN) + if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_MELEE && spellProto->SpellFamilyName == SPELLFAMILY_PALADIN) { - if(spellProto->SpellFamilyFlags & 0x0000000000800000LL && spellProto->SpellIconID == 561) + if ((spellProto->SpellFamilyFlags & UI64LIT(0x0000000000800000)) && spellProto->SpellIconID == 561) { if(pVictim->hasUnitState(UNIT_STAT_STUNNED)) return true; } } - } - case SPELL_DAMAGE_CLASS_RANGED: - { + if (pVictim) crit_chance = GetUnitCriticalChance(attackType, pVictim); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 205e47c65..86f41229b 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9065" + #define REVISION_NR "9066" #endif // __REVISION_NR_H__