Core/Spells: Adding SpellTargetObjectTypes to spell target checker to early-eliminate alive units

Port From (https://github.com/TrinityCore/TrinityCore/commit/0cae71eac58bf37c6a2cbce2a60dd2aa1f7b4314)
This commit is contained in:
hondacrx
2021-02-09 13:02:06 -05:00
parent a3e2e957c9
commit addc831f0d
5 changed files with 32 additions and 61 deletions
+1 -1
View File
@@ -807,7 +807,7 @@ namespace Scripts.Spells.Generic
Unit caster = GetCaster();
float max_range = GetSpellInfo().GetMaxRange(false);
// search for nearby enemy corpse in range
var check = new AnyDeadUnitSpellTargetInRangeCheck<Unit>(caster, max_range, GetSpellInfo(), SpellTargetCheckTypes.Enemy);
var check = new AnyDeadUnitSpellTargetInRangeCheck<Unit>(caster, max_range, GetSpellInfo(), SpellTargetCheckTypes.Enemy, SpellTargetObjectTypes.CorpseEnemy);
var searcher = new UnitSearcher(caster, check);
Cell.VisitWorldObjects(caster, searcher, max_range);
if (!searcher.GetTarget())