[7992] added additionally check for SPELL_EFFECT_OPEN_LOCK

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
This commit is contained in:
arrai 2009-06-11 12:49:56 +02:00
parent ea0f9bcf09
commit 2412e1fc9c
2 changed files with 5 additions and 1 deletions

View file

@ -4273,7 +4273,11 @@ SpellCastResult Spell::CheckCast(bool strict)
// get the lock entry // get the lock entry
uint32 lockId = 0; uint32 lockId = 0;
if (GameObject* go = m_targets.getGOTarget()) if (GameObject* go = m_targets.getGOTarget())
{
lockId = go->GetLockId(); lockId = go->GetLockId();
if (!lockId)
return SPELL_FAILED_BAD_TARGETS;
}
else if(Item* itm = m_targets.getItemTarget()) else if(Item* itm = m_targets.getItemTarget())
lockId = itm->GetProto()->LockID; lockId = itm->GetProto()->LockID;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7991" #define REVISION_NR "7992"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__