Core/Spells: Fix logic in AnyDeadUnitSpellTargetInRangeCheck - spells using this should now correctly check target requirements. This is an alternative fix to #4112.
This commit is contained in:
@@ -344,7 +344,7 @@ bool AnyDeadUnitObjectInRangeCheck::operator()(Creature* u)
|
||||
bool AnyDeadUnitSpellTargetInRangeCheck::operator()(Player* u)
|
||||
{
|
||||
return AnyDeadUnitObjectInRangeCheck::operator()(u)
|
||||
&& i_spellInfo->CheckTarget(i_searchObj, u, true)
|
||||
&& (i_spellInfo->CheckTarget(i_searchObj, u, true) == SPELL_CAST_OK)
|
||||
&& i_searchObj->IsTargetMatchingCheck(u, i_check);
|
||||
}
|
||||
|
||||
@@ -352,14 +352,14 @@ bool AnyDeadUnitSpellTargetInRangeCheck::operator()(Corpse* u)
|
||||
{
|
||||
Player* owner = ObjectAccessor::FindPlayer(u->GetOwnerGUID());
|
||||
return owner && AnyDeadUnitObjectInRangeCheck::operator()(u)
|
||||
&& i_spellInfo->CheckTarget(i_searchObj, owner, true)
|
||||
&& (i_spellInfo->CheckTarget(i_searchObj, owner, true) == SPELL_CAST_OK)
|
||||
&& i_searchObj->IsTargetMatchingCheck(owner, i_check);
|
||||
}
|
||||
|
||||
bool AnyDeadUnitSpellTargetInRangeCheck::operator()(Creature* u)
|
||||
{
|
||||
return AnyDeadUnitObjectInRangeCheck::operator()(u)
|
||||
&& i_spellInfo->CheckTarget(i_searchObj, u, true)
|
||||
&& (i_spellInfo->CheckTarget(i_searchObj, u, true) == SPELL_CAST_OK)
|
||||
&& i_searchObj->IsTargetMatchingCheck(u, i_check);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user