fix(Core/Spells): Hunter traps should not be activated by targets not… (#11971)

fix(Core/Spells): Hunter traps should not be activated by targets not in LoS.

Fixes #11432
This commit is contained in:
UltraNix
2022-06-06 14:03:24 +02:00
committed by GitHub
parent 7549eb59be
commit f28c678c14
3 changed files with 48 additions and 11 deletions

View File

@@ -701,8 +701,8 @@ void GameObject::Update(uint32 diff)
// search unfriendly creature
if (owner && goInfo->trap.autoCloseTime != -1) // hunter trap
{
Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
Acore::UnitSearcher<Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
Acore::NearestAttackableNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
Acore::UnitSearcher<Acore::NearestAttackableNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
Cell::VisitAllObjects(this, searcher, radius);
}
else // environmental trap