diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 49913e6d142e0..7c3d7514ffc84 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(SPELL_CAST_SOURCE_NORMAL, GetMapId(), spellEntry->Id, GetMap()->GenerateLowGuid()), 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();