aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/SpellHandler.cpp
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2018-07-19 12:46:31 +0200
committerTreeston <treeston.mmoc@gmail.com>2018-07-19 12:46:31 +0200
commit8a4858bdcfba5b2c9fca27869db72704af39c2e6 (patch)
treed43d0a82073b1927ac8eb3ce1ab97a403f9f78e5 /src/server/game/Handlers/SpellHandler.cpp
parent64a61e03ab0799b5437ddb9fe702c4912f3f9dd9 (diff)
Core/Handlers: Spell handler no longer downranks otherwise-negative spells because they have a potentially-positive aura effect. Closes #22153.
Diffstat (limited to 'src/server/game/Handlers/SpellHandler.cpp')
-rw-r--r--src/server/game/Handlers/SpellHandler.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp
index cf427c2e88e..f1637e4e39a 100644
--- a/src/server/game/Handlers/SpellHandler.cpp
+++ b/src/server/game/Handlers/SpellHandler.cpp
@@ -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