[9066] Small cleanups in spell code.

Mostly avoid unclear "lost" break case
This commit is contained in:
VladimirMangos 2009-12-25 21:03:37 +03:00
parent 3c2327e6e0
commit e583f543a2
3 changed files with 15 additions and 11 deletions

View file

@ -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);