chore(Core/Auras): Clean up Aura::CanBeSaved() (#9343)

This commit is contained in:
Kitzunu
2021-11-30 17:03:04 +01:00
committed by GitHub
parent d77d86e76d
commit f9337497d8
4 changed files with 29 additions and 42 deletions

View File

@@ -2806,10 +2806,10 @@ void SpellMgr::LoadSpellCustomAttr()
}
}
if ((attributes & SPELL_ATTR0_CU_FORCE_AURA_SAVING) && (attributes & SPELL_ATTR0_CU_REJECT_AURA_SAVING))
if ((attributes & SPELL_ATTR0_CU_FORCE_AURA_SAVING) && (attributes & SPELL_ATTR0_CU_AURA_CANNOT_BE_SAVED))
{
LOG_ERROR("sql.sql", "Table `spell_custom_attr` attribute1 field has attributes SPELL_ATTR1_CU_FORCE_AURA_SAVING and SPELL_ATTR1_CU_REJECT_AURA_SAVING which cannot stack for spell %u. Both attributes will get applied", spellId);
attributes &= ~(SPELL_ATTR0_CU_FORCE_AURA_SAVING | SPELL_ATTR0_CU_REJECT_AURA_SAVING);
LOG_ERROR("sql.sql", "Table `spell_custom_attr` attribute1 field has attributes SPELL_ATTR1_CU_FORCE_AURA_SAVING and SPELL_ATTR0_CU_AURA_CANNOT_BE_SAVED which cannot stack for spell %u. Both attributes will be ignored.", spellId);
attributes &= ~(SPELL_ATTR0_CU_FORCE_AURA_SAVING | SPELL_ATTR0_CU_AURA_CANNOT_BE_SAVED);
}
spellInfo->AttributesCu |= attributes;
@@ -2878,6 +2878,23 @@ void SpellMgr::LoadSpellCustomAttr()
break;
}
switch (spellInfo->Effects[j].ApplyAuraName)
{
case SPELL_AURA_CONVERT_RUNE: // Can't be saved - aura handler relies on calculated amount and changes it
case SPELL_AURA_OPEN_STABLE: // No point in saving this, since the stable dialog can't be open on aura load anyway.
// Auras that require both caster & target to be in world cannot be saved
case SPELL_AURA_CONTROL_VEHICLE:
case SPELL_AURA_BIND_SIGHT:
case SPELL_AURA_MOD_POSSESS:
case SPELL_AURA_MOD_POSSESS_PET:
case SPELL_AURA_MOD_CHARM:
case SPELL_AURA_AOE_CHARM:
spellInfo->AttributesCu |= SPELL_ATTR0_CU_AURA_CANNOT_BE_SAVED;
break;
default:
break;
}
switch (spellInfo->Effects[j].ApplyAuraName)
{
case SPELL_AURA_MOD_POSSESS: