Skip to content

Commit

Permalink
Make trap GOs with spell only consume charge if cast successful
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife authored and cyberium committed Jan 10, 2017
1 parent b883e4d commit f1a8aa6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/game/GameObject.cpp
Expand Up @@ -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));

Expand Down

0 comments on commit f1a8aa6

Please sign in to comment.