Avoid target requirement checks for spells with caster base target selection (self,pet,around). Author: VladimirMangos

This fix cast fail for some spells, mostly triggered or scripted with unexpected prowided explicit tatrget different from caster.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-02 10:03:38 +08:00
parent c1d94ad607
commit a1d5f174be
2 changed files with 29 additions and 4 deletions
+23
View File
@@ -270,6 +270,7 @@ bool IsDispelableBySpell(SpellEntry const * dispelSpell, uint32 spellId, bool de
bool IsSingleTargetSpell(SpellEntry const *spellInfo);
bool IsSingleTargetSpells(SpellEntry const *spellInfo1, SpellEntry const *spellInfo2);
extern bool IsAreaEffectTarget[TOTAL_SPELL_TARGETS];
inline bool IsAreaOfEffectSpell(SpellEntry const *spellInfo)
@@ -1051,6 +1052,28 @@ class SpellMgr
bool IsSrcTargetSpell(SpellEntry const *spellInfo) const;
inline bool IsCasterSourceTarget(uint32 target)
{
switch (SpellTargetType[target])
{
case TARGET_TYPE_UNIT_TARGET:
case TARGET_TYPE_DEST_TARGET:
return false;
default:
break;
}
return true;
}
inline bool IsSpellWithCasterSourceTargetsOnly(SpellEntry const* spellInfo)
{
for(int i = 0; i < 3; ++i)
if(uint32 target = spellInfo->EffectImplicitTargetA[i])
if(!IsCasterSourceTarget(target))
return false;
return true;
}
// Modifiers
public:
static SpellMgr& Instance();