mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
refactor(Core/SpellMgr): Remove nested ifs for binary evaluation. (#19762)
* Init. Co-Authored-By: Anton Popovichenko <walkline.ua@gmail.com> * Whitespace. * Tiny nitpick. Co-Authored-By: Anton Popovichenko <walkline.ua@gmail.com> * Tiny nitpick.* Today Bench learns the difference between break and continue. Co-Authored-By: Anton Popovichenko <walkline.ua@gmail.com> * Parentheses warnings. * Apply suggestion. Co-Authored-By: Anton Popovichenko <walkline.ua@gmail.com> --------- Co-authored-by: Anton Popovichenko <walkline.ua@gmail.com>
This commit is contained in:
@@ -3065,18 +3065,28 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
|
||||
continue;
|
||||
[[fallthrough]]; /// @todo: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
|
||||
default:
|
||||
if (spellInfo->Effects[j].CalcValue() || ((spellInfo->Effects[j].Effect == SPELL_EFFECT_INTERRUPT_CAST || spellInfo->HasAttribute(SPELL_ATTR0_CU_DONT_BREAK_STEALTH)) && !spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES)))
|
||||
if (spellInfo->Id != 69649 && spellInfo->Id != 71056 && spellInfo->Id != 71057 && spellInfo->Id != 71058 && spellInfo->Id != 73061 && spellInfo->Id != 73062 && spellInfo->Id != 73063 && spellInfo->Id != 73064) // Sindragosa Frost Breath
|
||||
if (spellInfo->SpellFamilyName != SPELLFAMILY_MAGE || !(spellInfo->SpellFamilyFlags[0] & 0x20)) // frostbolt
|
||||
if (spellInfo->Id != 55095) // frost fever
|
||||
if (spellInfo->SpellFamilyName != SPELLFAMILY_WARLOCK || !(spellInfo->SpellFamilyFlags[1] & 0x40000)) // Haunt
|
||||
if (spellInfo->SpellFamilyName != SPELLFAMILY_WARLOCK || !(spellInfo->SpellFamilyFlags[0] & 0x4000)) // Drain Soul
|
||||
{
|
||||
if (!(spellInfo->Effects[j].CalcValue() &&
|
||||
((spellInfo->Effects[j].Effect == SPELL_EFFECT_INTERRUPT_CAST || spellInfo->HasAttribute(SPELL_ATTR0_CU_DONT_BREAK_STEALTH)) &&
|
||||
!spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES))))
|
||||
continue;
|
||||
|
||||
if (spellInfo->Id == 69649 || spellInfo->Id == 71056 || spellInfo->Id == 71057 || spellInfo->Id == 71058 ||
|
||||
spellInfo->Id == 73061 || spellInfo->Id == 73062 || spellInfo->Id == 73063 || spellInfo->Id == 73064)
|
||||
continue;
|
||||
|
||||
if (spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && (spellInfo->SpellFamilyFlags[0] & 0x20)) // Frostbolt
|
||||
continue;
|
||||
|
||||
if (spellInfo->Id == 55095) // Frost Fever
|
||||
continue;
|
||||
|
||||
if (spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK &&
|
||||
((spellInfo->SpellFamilyFlags[1] & 0x40000) || (spellInfo->SpellFamilyFlags[0] & 0x4000))) // Haunt/Drain Soul
|
||||
continue;
|
||||
|
||||
spellInfo->AttributesCu |= SPELL_ATTR0_CU_BINARY_SPELL;
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user