aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 7dedf9418c0..c588739db89 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -12460,6 +12460,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;
@@ -12485,7 +12486,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
{
@@ -12507,7 +12508,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);
@@ -12519,7 +12520,7 @@ void Unit::HandleSpellClick(Unit* clicker, int8 seatId /*= -1*/)
}
}
- spellClickHandled = true;
+ spellClickHandled = castResult == SPELL_FAILED_SUCCESS;
}
Creature* creature = ToCreature();