diff options
Diffstat (limited to 'src/server/game/Spells/SpellMgr.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index b3f17fe8372..02f34a1feac 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2610,7 +2610,6 @@ void SpellMgr::LoadSpellInfoCustomAttributes() { uint32 oldMSTime = getMSTime(); uint32 oldMSTime2 = oldMSTime; - SpellInfo* spellInfo = nullptr; QueryResult result = WorldDatabase.Query("SELECT entry, attributes FROM spell_custom_attr"); @@ -2626,7 +2625,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes() uint32 spellId = fields[0].GetUInt32(); uint32 attributes = fields[1].GetUInt32(); - spellInfo = _GetSpellInfo(spellId); + SpellInfo* spellInfo = _GetSpellInfo(spellId); if (!spellInfo) { TC_LOG_ERROR("sql.sql", "Table `spell_custom_attr` has wrong spell (entry: %u), ignored.", spellId); @@ -2655,14 +2654,17 @@ void SpellMgr::LoadSpellInfoCustomAttributes() TC_LOG_INFO("server.loading", ">> Loaded %u spell custom attributes from DB in %u ms", count, GetMSTimeDiffToNow(oldMSTime2)); } - for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) + for (SpellInfo* spellInfo : mSpellInfoMap) { - spellInfo = mSpellInfoMap[i]; if (!spellInfo) continue; for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) { + // all bleed effects and spells ignore armor + if (spellInfo->GetEffectMechanicMask(j) & (1 << MECHANIC_BLEED)) + spellInfo->AttributesCu |= SPELL_ATTR0_CU_IGNORE_ARMOR; + switch (spellInfo->Effects[j].ApplyAuraName) { case SPELL_AURA_MOD_POSSESS: @@ -2739,7 +2741,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes() case SPELL_EFFECT_ENCHANT_HELD_ITEM: { // only enchanting profession enchantments procs can stack - if (IsPartOfSkillLine(SKILL_ENCHANTING, i)) + if (IsPartOfSkillLine(SKILL_ENCHANTING, spellInfo->Id)) { uint32 enchantId = spellInfo->Effects[j].MiscValue; SpellItemEnchantmentEntry const* enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId); @@ -2877,9 +2879,8 @@ void SpellMgr::LoadSpellInfoCustomAttributes() } // addition for binary spells, omit spells triggering other spells - for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) + for (SpellInfo* spellInfo : mSpellInfoMap) { - spellInfo = mSpellInfoMap[i]; if (!spellInfo) continue; @@ -2915,9 +2916,8 @@ void SpellMgr::LoadSpellInfoCustomAttributes() // remove attribute from spells that can't crit // and mark triggering spell (instead of triggered spell) for spells with SPELL_ATTR4_INHERIT_CRIT_FROM_AURA - for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) + for (SpellInfo* spellInfo : mSpellInfoMap) { - spellInfo = mSpellInfoMap[i]; if (!spellInfo) continue; |
