From f1a8aa69f2283a226265b7624649c725f69a0bd6 Mon Sep 17 00:00:00 2001 From: killerwife Date: Mon, 20 Jun 2016 19:41:17 +0200 Subject: [PATCH] Make trap GOs with spell only consume charge if cast successful --- src/game/GameObject.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 1c66574258f..93215a5bd21 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -1155,7 +1155,8 @@ void GameObject::Use(Unit* user) // FIXME: when GO casting will be implemented trap must cast spell to target if (goInfo->trap.spellId) - caster->CastSpell(user, goInfo->trap.spellId, TRIGGERED_OLD_TRIGGERED, nullptr, nullptr, GetObjectGuid()); + if (caster->CastSpell(user, goInfo->trap.spellId, TRIGGERED_OLD_TRIGGERED, nullptr, nullptr, GetObjectGuid()) != SPELL_CAST_OK) + return; // use template cooldown if provided m_cooldownTime = time(nullptr) + (goInfo->trap.cooldown ? goInfo->trap.cooldown : uint32(4));