Fix errors

This commit is contained in:
DrSmugleaf
2021-12-05 21:02:04 +01:00
parent 2a3b7d809d
commit ab9d0cc6d8
94 changed files with 568 additions and 591 deletions

View File

@@ -6,17 +6,17 @@ using Content.Server.Ghost.Roles.Components;
using Content.Server.Ghost.Roles.UI;
using Content.Server.Players;
using Content.Shared.GameTicking;
using Content.Shared.Ghost.Roles;
using Content.Shared.Ghost;
using Content.Shared.Ghost.Roles;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Console;
using Robust.Shared.Enums;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.ViewVariables;
using Robust.Shared.Utility;
using Robust.Shared.Enums;
using Robust.Shared.ViewVariables;
namespace Content.Server.Ghost.Roles
{
@@ -59,7 +59,8 @@ namespace Content.Server.Ghost.Roles
public void OpenEui(IPlayerSession session)
{
if (session.AttachedEntity == null || !IoCManager.Resolve<IEntityManager>().HasComponent<GhostComponent>(session.AttachedEntity))
if (session.AttachedEntity is not {Valid: true} attached ||
!EntityManager.HasComponent<GhostComponent>(attached))
return;
if(_openUis.ContainsKey(session))
@@ -194,7 +195,7 @@ namespace Content.Server.Ghost.Roles
{
// Close the session of any player that has a ghost roles window open and isn't a ghost anymore.
if (!_openUis.ContainsKey(message.Player)) return;
if (IoCManager.Resolve<IEntityManager>().HasComponent<GhostComponent>(message.Entity)) return;
if (EntityManager.HasComponent<GhostComponent>(message.Entity)) return;
CloseEui(message.Player);
}