aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-11 19:47:58 -0500
committermegamage <none@none>2009-06-11 19:47:58 -0500
commite6badd83fc90dc463e5321ef892c22545da10bb6 (patch)
tree8b67ff3afba0c31003e01ceb680e0dc4f09dce18 /src
parenteb812d52d1387c53eb840c11b6e942b44a89945c (diff)
[7992] added additionally check for SPELL_EFFECT_OPEN_LOCK Author: arrai
Every gameobject which may be a target of such a spelleffect has to have a lockid. Prior to this commit it was possible to exploit SPELL_EFFECT_OPEN_LOCK spells and despawn abitrary GOs --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Spell.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 544161e38e0..fbc4b026a9d 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -4565,7 +4565,11 @@ SpellCastResult Spell::CheckCast(bool strict)
// get the lock entry
uint32 lockId = 0;
if (GameObject* go = m_targets.getGOTarget())
+ {
lockId = go->GetLockId();
+ if (!lockId)
+ return SPELL_FAILED_BAD_TARGETS;
+ }
else if(Item* itm = m_targets.getItemTarget())
lockId = itm->GetProto()->LockID;