Core/Handlers: Spell handler no longer downranks otherwise-negative spells because they have a potentially-positive aura effect. Closes #22153.

This commit is contained in:
Treeston
2018-07-19 12:46:31 +02:00
parent 64a61e03ab
commit 8a4858bdcf
3 changed files with 12 additions and 10 deletions

View File

@@ -404,14 +404,16 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
}
// auto-selection buff level base at target level (in spellInfo)
if (targets.GetUnitTarget())
{
SpellInfo const* actualSpellInfo = spellInfo->GetAuraRankForLevel(targets.GetUnitTarget()->getLevel());
// TODO: is this even necessary? client already seems to send correct rank for "standard" buffs
if (spellInfo->IsPositive())
if (Unit* target = targets.GetUnitTarget())
{
SpellInfo const* actualSpellInfo = spellInfo->GetAuraRankForLevel(target->getLevel());
// if rank not found then function return NULL but in explicit cast case original spell can be cast and later failed with appropriate error message
if (actualSpellInfo)
spellInfo = actualSpellInfo;
}
// if rank not found then function return NULL but in explicit cast case original spell can be cast and later failed with appropriate error message
if (actualSpellInfo)
spellInfo = actualSpellInfo;
}
Spell* spell = new Spell(caster, spellInfo, TRIGGERED_NONE);
spell->m_cast_count = castCount; // set count of casts