aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy <Golrag@users.noreply.github.com>2024-10-31 08:28:17 +0100
committerGitHub <noreply@github.com>2024-10-31 08:28:17 +0100
commit214580d345616b492ce9654ef30c1a436d224b25 (patch)
treefd1762d9909e5c854d9855414fe6cb758cea0c27 /src
parentf689a801854da2eb7efd5ae09d7251075de781cb (diff)
Core/Units: only set spellClickHandled to true when spell cast was succesful (#30388)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 49913e6d142..7c3d7514ffc 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -12345,6 +12345,7 @@ void Unit::HandleSpellClick(Unit* clicker, int8 seatId /*= -1*/)
SpellInfo const* spellEntry = sSpellMgr->AssertSpellInfo(clickPair.second.spellId, caster->GetMap()->GetDifficultyID());
// if (!spellEntry) should be checked at npc_spellclick load
+ SpellCastResult castResult = SPELL_FAILED_SUCCESS;
if (seatId > -1)
{
uint8 i = 0;
@@ -12370,7 +12371,7 @@ void Unit::HandleSpellClick(Unit* clicker, int8 seatId /*= -1*/)
CastSpellExtraArgs args(flags);
args.OriginalCaster = origCasterGUID;
args.AddSpellMod(SpellValueMod(SPELLVALUE_BASE_POINT0 + i), seatId + 1);
- caster->CastSpell(target, clickPair.second.spellId, args);
+ castResult = caster->CastSpell(target, clickPair.second.spellId, args);
}
else // This can happen during Player::_LoadAuras
{
@@ -12392,7 +12393,7 @@ void Unit::HandleSpellClick(Unit* clicker, int8 seatId /*= -1*/)
else
{
if (IsInMap(caster))
- caster->CastSpell(target, spellEntry->Id, CastSpellExtraArgs().SetOriginalCaster(origCasterGUID));
+ castResult = caster->CastSpell(target, spellEntry->Id, CastSpellExtraArgs().SetOriginalCaster(origCasterGUID));
else
{
AuraCreateInfo createInfo(ObjectGuid::Create<HighGuid::Cast>(SPELL_CAST_SOURCE_NORMAL, GetMapId(), spellEntry->Id, GetMap()->GenerateLowGuid<HighGuid::Cast>()), spellEntry, GetMap()->GetDifficultyID(), MAX_EFFECT_MASK, this);
@@ -12404,7 +12405,7 @@ void Unit::HandleSpellClick(Unit* clicker, int8 seatId /*= -1*/)
}
}
- spellClickHandled = true;
+ spellClickHandled = castResult == SPELL_FAILED_SUCCESS;
}
Creature* creature = ToCreature();