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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user