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:
11
Content.Server/NPC/Queries/Queries/RemoveAnchored.cs
Normal file
11
Content.Server/NPC/Queries/Queries/RemoveAnchored.cs
Normal 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
|
||||
{
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -131,6 +131,7 @@
|
||||
types:
|
||||
Blunt: 0
|
||||
- type: Item
|
||||
- !type:RemoveAnchoredFilter
|
||||
considerations:
|
||||
- !type:TargetMeleeCon
|
||||
curve: !type:QuadraticCurve
|
||||
|
||||
Reference in New Issue
Block a user