fix(Core/Spells): FIxed calculating LoS for dynamic objects. (#13795)

Fixes #13777
This commit is contained in:
UltraNix
2022-11-16 05:19:29 +01:00
committed by GitHub
parent 853cf6c142
commit 3603f44dad
3 changed files with 12 additions and 10 deletions

View File

@@ -2926,13 +2926,15 @@ void DynObjAura::FillTargetMap(std::map<Unit*, uint8>& targets, Unit* /*caster*/
Unit* target = *itr;
Optional<float> collisionHeight = { };
Optional<float> combatReach = { };
if (Unit* dynObjCaster = GetDynobjOwner()->GetCaster())
{
collisionHeight = dynObjCaster->GetCollisionHeight();
combatReach = dynObjCaster->GetCombatReach();
}
if (!spellInfo->HasAttribute(SPELL_ATTR2_IGNORE_LINE_OF_SIGHT) && !spellInfo->HasAttribute(SPELL_ATTR5_ALWAYS_AOE_LINE_OF_SIGHT) &&
!target->IsWithinLOSInMap(GetDynobjOwner(), VMAP::ModelIgnoreFlags::Nothing, LINEOFSIGHT_ALL_CHECKS, collisionHeight))
!GetDynobjOwner()->IsWithinLOSInMap(target, VMAP::ModelIgnoreFlags::Nothing, LINEOFSIGHT_ALL_CHECKS, collisionHeight, combatReach))
{
continue;
}