NPCs no longer consider anchored pipes as weapons (#30061)

* Anchored pipes are no longer considered weapons

* Switch to overload utilizing a TransformQuery
This commit is contained in:
osjarw
2024-07-21 10:28:37 +03:00
committed by GitHub
parent c7ff647cb3
commit 644736b382
3 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
using Robust.Shared.Prototypes;
namespace Content.Server.NPC.Queries.Queries;
/// <summary>
/// Remove anchored entities from the query
/// </summary>
public sealed partial class RemoveAnchoredFilter : UtilityQueryFilter
{
}

View File

@@ -499,6 +499,26 @@ public sealed class NPCUtilitySystem : EntitySystem
break;
}
case RemoveAnchoredFilter:
{
_entityList.Clear();
foreach (var ent in entities)
{
if (!TryComp(ent, out TransformComponent? xform))
continue;
if (xform.Anchored)
_entityList.Add(ent);
}
foreach (var ent in _entityList)
{
entities.Remove(ent);
}
break;
}
case PuddleFilter:
{
_entityList.Clear();

View File

@@ -131,6 +131,7 @@
types:
Blunt: 0
- type: Item
- !type:RemoveAnchoredFilter
considerations:
- !type:TargetMeleeCon
curve: !type:QuadraticCurve