From 07df574b432c641c37691b43d199daa4f69b2602 Mon Sep 17 00:00:00 2001 From: robinsch Date: Sat, 13 Jun 2015 20:40:18 +0200 Subject: [3.3.5] Core/Spells: Omen of Clarity by @robinsch; closes #3088. Purpose: make the Omen of Clarity druid buff (http://wotlk.openwow.com/spell=16864) work as intended. This change is an addition to @Shauren's commit 37145b6. Before this change, spell mod auras lose charges when they are unable to be cast as mentioned in the issue. As an example: Omen of Clarity loses its charge when Shred can not be used, because it requires the caster to behind the target. This change will restore the spell mod if CheckCast returns false for the initial cast. --- src/server/game/Spells/Spell.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 11bf2163aaa..bd42bc169f9 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2901,6 +2901,14 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered triggeredByAura->GetBase()->SetDuration(0); } + if (m_caster->GetTypeId() == TYPEID_PLAYER) + { + m_caster->ToPlayer()->RestoreSpellMods(this); + // cleanup after mod system + // triggered spell pointer can be not removed in some cases + m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); + } + SendCastResult(result); finish(false); -- cgit v1.2.3