Fix traitor identification overlay (#2978)

This commit is contained in:
ShadowCommander
2021-01-10 15:50:04 -08:00
committed by GitHub
parent c01b1d5c05
commit 2249081443
2 changed files with 12 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
using Content.Shared.GameObjects.EntitySystems; using Content.Shared.GameObjects.EntitySystems;
using Robust.Client.Graphics; using Robust.Client.Graphics;
using Robust.Client.Graphics.Drawing; using Robust.Client.Graphics.Drawing;
using Robust.Client.Graphics.Overlays; using Robust.Client.Graphics.Overlays;
@@ -64,18 +64,18 @@ namespace Content.Client.GameObjects.Components.Suspicion
// Otherwise the entity can not exist yet // Otherwise the entity can not exist yet
if (!_entityManager.TryGetEntity(uid, out var ally)) if (!_entityManager.TryGetEntity(uid, out var ally))
{ {
return; continue;
} }
if (!ally.TryGetComponent(out IPhysicsComponent physics)) if (!ally.TryGetComponent(out IPhysicsComponent physics))
{ {
return; continue;
} }
if (!ExamineSystemShared.InRangeUnOccluded(ent.Transform.MapPosition, ally.Transform.MapPosition, 15, if (!ExamineSystemShared.InRangeUnOccluded(ent.Transform.MapPosition, ally.Transform.MapPosition, 15,
entity => entity == ent || entity == ally)) entity => entity == ent || entity == ally))
{ {
return; continue;
} }
// all entities have a TransformComponent // all entities have a TransformComponent

View File

@@ -1,12 +1,13 @@
using System.Collections.Generic; using System.Collections.Generic;
using Content.Server.GameObjects.Components.Suspicion; using Content.Server.GameObjects.Components.Suspicion;
using Content.Shared.GameTicking;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.GameObjects.Systems; using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems namespace Content.Server.GameObjects.EntitySystems
{ {
[UsedImplicitly] [UsedImplicitly]
public class SuspicionRoleSystem : EntitySystem public class SuspicionRoleSystem : EntitySystem, IResettingEntitySystem
{ {
private readonly HashSet<SuspicionRoleComponent> _traitors = new(); private readonly HashSet<SuspicionRoleComponent> _traitors = new();
@@ -47,5 +48,10 @@ namespace Content.Server.GameObjects.EntitySystems
_traitors.Clear(); _traitors.Clear();
base.Shutdown(); base.Shutdown();
} }
public void Reset()
{
_traitors.Clear();
}
} }
} }