Fix NPC line of sight not working if trying to ranged target a blocking entity (#30055)

This commit is contained in:
DrSmugleaf
2024-07-19 20:58:33 -07:00
committed by GitHub
parent 1783e0e4c2
commit 4aba9ec131

View File

@@ -1,7 +1,6 @@
using Content.Server.NPC.Components; using Content.Server.NPC.Components;
using Content.Shared.CombatMode; using Content.Shared.CombatMode;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Physics;
using Content.Shared.Weapons.Ranged.Components; using Content.Shared.Weapons.Ranged.Components;
using Content.Shared.Weapons.Ranged.Events; using Content.Shared.Weapons.Ranged.Events;
using Robust.Shared.Map; using Robust.Shared.Map;
@@ -134,7 +133,7 @@ public sealed partial class NPCCombatSystem
{ {
comp.LOSAccumulator += UnoccludedCooldown; comp.LOSAccumulator += UnoccludedCooldown;
// For consistency with NPC steering. // For consistency with NPC steering.
comp.TargetInLOS = _interaction.InRangeUnobstructed(uid, Transform(comp.Target).Coordinates, distance + 0.1f); comp.TargetInLOS = _interaction.InRangeUnobstructed(uid, comp.Target, distance + 0.1f);
} }
if (!comp.TargetInLOS) if (!comp.TargetInLOS)