view ghosts on round end (#11680)

* view ghosts on round end

* now make it good

* it toggles now i hope
This commit is contained in:
Nemanja
2022-10-05 22:55:11 -04:00
committed by GitHub
parent f5a9ba5cfa
commit f6234c7920
4 changed files with 112 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
using Content.Server.Visible;
using Content.Server.GameTicking;
using Content.Server.Visible;
using Content.Shared.Revenant.Components;
using Content.Shared.Revenant.EntitySystems;
using Robust.Server.GameObjects;
@@ -8,6 +9,7 @@ namespace Content.Server.Revenant.EntitySystems;
public sealed class CorporealSystem : SharedCorporealSystem
{
[Dependency] private readonly VisibilitySystem _visibilitySystem = default!;
[Dependency] private readonly GameTicker _ticker = default!;
public override void OnStartup(EntityUid uid, CorporealComponent component, ComponentStartup args)
{
@@ -25,7 +27,7 @@ public sealed class CorporealSystem : SharedCorporealSystem
{
base.OnShutdown(uid, component, args);
if (TryComp<VisibilityComponent>(uid, out var visibility))
if (TryComp<VisibilityComponent>(uid, out var visibility) && _ticker.RunLevel != GameRunLevel.PostRound)
{
_visibilitySystem.AddLayer(visibility, (int) VisibilityFlags.Ghost, false);
_visibilitySystem.RemoveLayer(visibility, (int) VisibilityFlags.Normal, false);