mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Core/Spells: Fix pick lock - thanks to cyberbrest for pointing the reason of this issue.
This commit is contained in:
@@ -4756,7 +4756,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
}
|
||||
|
||||
{
|
||||
SpellCastResult castResult = m_spellInfo->CheckExplicitTarget(m_caster, m_targets.GetObjectTarget());
|
||||
SpellCastResult castResult = m_spellInfo->CheckExplicitTarget(m_caster, m_targets.GetObjectTarget(), m_targets.GetItemTarget());
|
||||
if (castResult != SPELL_CAST_OK)
|
||||
return castResult;
|
||||
}
|
||||
|
||||
@@ -1721,13 +1721,14 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, Unit const* target, b
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
SpellCastResult SpellInfo::CheckExplicitTarget(Unit const* caster, WorldObject const* target) const
|
||||
SpellCastResult SpellInfo::CheckExplicitTarget(Unit const* caster, WorldObject const* target, Item const* itemTarget) const
|
||||
{
|
||||
uint32 neededTargets = GetExplicitTargetMask();
|
||||
if (!target)
|
||||
{
|
||||
if (neededTargets & (TARGET_FLAG_UNIT_MASK | TARGET_FLAG_GAMEOBJECT_MASK | TARGET_FLAG_CORPSE_MASK))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
if (!(neededTargets & TARGET_FLAG_GAMEOBJECT_ITEM) || !itemTarget)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
class Unit;
|
||||
class Player;
|
||||
class Item;
|
||||
class Spell;
|
||||
class SpellInfo;
|
||||
struct SpellChainNode;
|
||||
@@ -442,7 +443,7 @@ public:
|
||||
SpellCastResult CheckShapeshift(uint32 form) const;
|
||||
SpellCastResult CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player = NULL) const;
|
||||
SpellCastResult CheckTarget(Unit const* caster, Unit const* target, bool implicit = true) const;
|
||||
SpellCastResult CheckExplicitTarget(Unit const* caster, WorldObject const* target) const;
|
||||
SpellCastResult CheckExplicitTarget(Unit const* caster, WorldObject const* target, Item const* itemTarget = NULL) const;
|
||||
bool CheckTargetCreatureType(Unit const* target) const;
|
||||
|
||||
SpellSchoolMask GetSchoolMask() const;
|
||||
|
||||
Reference in New Issue
Block a user