fix(Core/Spells): Fixed LoS problems with hunter traps. (#12348)

* fix(Core/Spells): Fixed LoS problems with hunter traps.

Fixes #12332

* missing
This commit is contained in:
UltraNix
2022-07-10 20:18:36 +02:00
committed by GitHub
parent 40e28f2492
commit 12a07ff91f
4 changed files with 26 additions and 14 deletions

View File

@@ -925,7 +925,19 @@ namespace Acore
return false;
}
if (!i_obj->IsWithinDistInMap(u, i_range) || !i_owner->IsValidAttackTarget(u) || !i_obj->IsWithinLOSInMap(u))
uint32 losChecks = LINEOFSIGHT_ALL_CHECKS;
Optional<float> collisionHeight = { };
if (i_obj->GetTypeId() == TYPEID_GAMEOBJECT)
{
losChecks &= ~LINEOFSIGHT_CHECK_GOBJECT_M2;
if (i_owner->IsPlayer())
{
collisionHeight = i_owner->GetCollisionHeight();
}
}
if (!i_obj->IsWithinDistInMap(u, i_range) || !i_owner->IsValidAttackTarget(u) ||
!i_obj->IsWithinLOSInMap(u, VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks(losChecks), collisionHeight))
{
return false;
}