Fix NPC line of sight not working if trying to ranged target a blocking entity (#30055)
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user