fix fish petting (#16094)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
using System.Linq;
|
||||
using Content.Server.NPC.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
using System.Linq;
|
||||
|
||||
namespace Content.Server.NPC.Systems;
|
||||
|
||||
namespace Content.Server.NPC.Systems
|
||||
{
|
||||
/// <summary>
|
||||
/// Outlines faction relationships with each other.
|
||||
/// </summary>
|
||||
public sealed class FactionSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _protoManager = default!;
|
||||
[Dependency] private readonly FactionExceptionSystem _factionException = default!;
|
||||
[Dependency] private readonly EntityLookupSystem _lookup = default!;
|
||||
[Dependency] private readonly IPrototypeManager _protoManager = default!;
|
||||
|
||||
private ISawmill _sawmill = default!;
|
||||
|
||||
@@ -115,7 +116,14 @@ namespace Content.Server.NPC.Systems
|
||||
if (!Resolve(entity, ref component, false))
|
||||
return Array.Empty<EntityUid>();
|
||||
|
||||
return GetNearbyFactions(entity, range, component.HostileFactions);
|
||||
var hostiles = GetNearbyFactions(entity, range, component.HostileFactions);
|
||||
if (TryComp<FactionExceptionComponent>(entity, out var factionException))
|
||||
{
|
||||
// ignore anything from enemy faction that we are explicitly friendly towards
|
||||
return hostiles.Where(target => !_factionException.IsIgnored(factionException, target));
|
||||
}
|
||||
|
||||
return hostiles;
|
||||
}
|
||||
|
||||
public IEnumerable<EntityUid> GetNearbyFriendlies(EntityUid entity, float range, FactionComponent? component = null)
|
||||
@@ -218,4 +226,4 @@ namespace Content.Server.NPC.Systems
|
||||
RefreshFactions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user