From 2249081443c1431bd776236cec3ad8fd6c53e5c9 Mon Sep 17 00:00:00 2001 From: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Date: Sun, 10 Jan 2021 15:50:04 -0800 Subject: [PATCH] Fix traitor identification overlay (#2978) --- .../GameObjects/Components/Suspicion/TraitorOverlay.cs | 8 ++++---- .../GameObjects/EntitySystems/SuspicionRoleSystem.cs | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Content.Client/GameObjects/Components/Suspicion/TraitorOverlay.cs b/Content.Client/GameObjects/Components/Suspicion/TraitorOverlay.cs index abf40e340c..414582fdc9 100644 --- a/Content.Client/GameObjects/Components/Suspicion/TraitorOverlay.cs +++ b/Content.Client/GameObjects/Components/Suspicion/TraitorOverlay.cs @@ -1,4 +1,4 @@ -using Content.Shared.GameObjects.EntitySystems; +using Content.Shared.GameObjects.EntitySystems; using Robust.Client.Graphics; using Robust.Client.Graphics.Drawing; using Robust.Client.Graphics.Overlays; @@ -64,18 +64,18 @@ namespace Content.Client.GameObjects.Components.Suspicion // Otherwise the entity can not exist yet if (!_entityManager.TryGetEntity(uid, out var ally)) { - return; + continue; } if (!ally.TryGetComponent(out IPhysicsComponent physics)) { - return; + continue; } if (!ExamineSystemShared.InRangeUnOccluded(ent.Transform.MapPosition, ally.Transform.MapPosition, 15, entity => entity == ent || entity == ally)) { - return; + continue; } // all entities have a TransformComponent diff --git a/Content.Server/GameObjects/EntitySystems/SuspicionRoleSystem.cs b/Content.Server/GameObjects/EntitySystems/SuspicionRoleSystem.cs index fb7fef8e65..7bfb191404 100644 --- a/Content.Server/GameObjects/EntitySystems/SuspicionRoleSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/SuspicionRoleSystem.cs @@ -1,12 +1,13 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Content.Server.GameObjects.Components.Suspicion; +using Content.Shared.GameTicking; using JetBrains.Annotations; using Robust.Shared.GameObjects.Systems; namespace Content.Server.GameObjects.EntitySystems { [UsedImplicitly] - public class SuspicionRoleSystem : EntitySystem + public class SuspicionRoleSystem : EntitySystem, IResettingEntitySystem { private readonly HashSet _traitors = new(); @@ -47,5 +48,10 @@ namespace Content.Server.GameObjects.EntitySystems _traitors.Clear(); base.Shutdown(); } + + public void Reset() + { + _traitors.Clear(); + } } }