[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
This commit is contained in:
megamage
2009-06-11 19:47:58 -05:00
parent eb812d52d1
commit e6badd83fc

View File

@@ -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;