Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rat King pointing near a locker does not mean servants understand they are pointing at someone in the locker #1105

Merged
merged 8 commits into from
Dec 24, 2024
7 changes: 5 additions & 2 deletions Content.Server/RatKing/RatKingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Content.Shared.RatKing;
using Robust.Shared.Map;
using Robust.Shared.Random;
using Robust.Shared.Containers;
using Content.Shared.Damage;
using Content.Shared.SubFloor;
using Content.Shared.Body;
Expand All @@ -31,6 +32,8 @@ public sealed class RatKingSystem : SharedRatKingSystem
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;

[Dependency] private readonly SharedContainerSystem _container = default!;

public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -130,10 +133,10 @@ private void OnPointedNearby(EntityUid uid, RatKingComponent component, ref Afte
continue;

// Remove ineligable targets
if (!TryComp<DamageableComponent>(ent, out var _1) || !TryComp<BodyComponent>(ent, out var _2))
if (!HasComp<DamageableComponent>(ent) || !HasComp<BodyComponent>(ent) || !_container.IsEntityInContainer(ent))
TheGrimbeeper marked this conversation as resolved.
Show resolved Hide resolved
continue;

if (TryComp<SubFloorHideComponent>(ent, out var _3) || TryComp<RatKingServantComponent>(ent, out var _4))
if (HasComp<SubFloorHideComponent>(ent) || HasComp<RatKingServantComponent>(ent))
continue;

if (!arrowXform.Coordinates.TryDistance(EntityManager, Transform(ent).Coordinates, out var distance))
Expand Down
Loading