Fix 3000 errors
This commit is contained in:
@@ -4,14 +4,11 @@ using Content.Server.Atmos.Components;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Server.Atmos.Piping.Components;
|
||||
using Content.Server.Atmos.Piping.Unary.Components;
|
||||
using Content.Server.Destructible;
|
||||
using Content.Server.Hands.Components;
|
||||
using Content.Server.NodeContainer;
|
||||
using Content.Server.NodeContainer.NodeGroups;
|
||||
using Content.Server.NodeContainer.Nodes;
|
||||
using Content.Server.UserInterface;
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Atmos.Piping.Binary.Components;
|
||||
using Content.Shared.Database;
|
||||
@@ -19,7 +16,6 @@ using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Helpers;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
@@ -85,7 +81,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
|
||||
private bool CheckInteract(ICommonSession session)
|
||||
{
|
||||
if (session.AttachedEntityUid is not {} uid
|
||||
if (session.AttachedEntity is not {} uid
|
||||
|| !_actionBlockerSystem.CanInteract(uid)
|
||||
|| !_actionBlockerSystem.CanUse(uid))
|
||||
return false;
|
||||
@@ -110,14 +106,14 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
if (containerManager.TryGetContainer(canister.ContainerName, out var tankContainer)
|
||||
&& tankContainer.ContainedEntities.Count > 0)
|
||||
{
|
||||
var tank = (EntityUid) tankContainer.ContainedEntities[0];
|
||||
var tank = tankContainer.ContainedEntities[0];
|
||||
var tankComponent = EntityManager.GetComponent<GasTankComponent>(tank);
|
||||
tankLabel = EntityManager.GetComponent<MetaDataComponent>(tank).EntityName;
|
||||
tankPressure = tankComponent.Air.Pressure;
|
||||
}
|
||||
|
||||
_userInterfaceSystem.TrySetUiState(uid, GasCanisterUiKey.Key,
|
||||
new GasCanisterBoundUserInterfaceState(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(canister.Owner).EntityName,
|
||||
new GasCanisterBoundUserInterfaceState(EntityManager.GetComponent<MetaDataComponent>(canister.Owner).EntityName,
|
||||
canister.Air.Pressure, portStatus, tankLabel, tankPressure, canister.ReleasePressure,
|
||||
canister.ReleaseValve, canister.MinReleasePressure, canister.MaxReleasePressure));
|
||||
}
|
||||
@@ -205,13 +201,12 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
|
||||
if (container.ContainedEntities.Count > 0)
|
||||
{
|
||||
IEntity tempQualifier = container.ContainedEntities[0];
|
||||
var gasTank = IoCManager.Resolve<IEntityManager>().GetComponent<GasTankComponent>(tempQualifier);
|
||||
var gasTank = EntityManager.GetComponent<GasTankComponent>(container.ContainedEntities[0]);
|
||||
_atmosphereSystem.ReleaseGasTo(canister.Air, gasTank.Air, canister.ReleasePressure);
|
||||
}
|
||||
else
|
||||
{
|
||||
var environment = _atmosphereSystem.GetTileMixture(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(canister.Owner).Coordinates, true);
|
||||
var environment = _atmosphereSystem.GetTileMixture(EntityManager.GetComponent<TransformComponent>(canister.Owner).Coordinates, true);
|
||||
_atmosphereSystem.ReleaseGasTo(canister.Air, environment, canister.ReleasePressure);
|
||||
}
|
||||
}
|
||||
@@ -244,7 +239,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
|
||||
private void OnCanisterActivate(EntityUid uid, GasCanisterComponent component, ActivateInWorldEvent args)
|
||||
{
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out ActorComponent? actor))
|
||||
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
|
||||
return;
|
||||
|
||||
_userInterfaceSystem.GetUiOrNull(uid, GasCanisterUiKey.Key)?.Open(actor.PlayerSession);
|
||||
@@ -254,16 +249,15 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
|
||||
private void OnCanisterInteractHand(EntityUid uid, GasCanisterComponent component, InteractHandEvent args)
|
||||
{
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out ActorComponent? actor))
|
||||
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
|
||||
return;
|
||||
|
||||
_userInterfaceSystem.GetUiOrNull(uid, GasCanisterUiKey.Key)?.Open(actor.PlayerSession);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
private void OnCanisterInteractUsing(EntityUid uid, GasCanisterComponent component, InteractUsingEvent args)
|
||||
private void OnCanisterInteractUsing(EntityUid canister, GasCanisterComponent component, InteractUsingEvent args)
|
||||
{
|
||||
var canister = EntityManager.GetEntity(uid);
|
||||
var container = canister.EnsureContainer<ContainerSlot>(component.ContainerName);
|
||||
|
||||
// Container full.
|
||||
@@ -271,11 +265,11 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
return;
|
||||
|
||||
// Check the used item is valid...
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.Used, out GasTankComponent? _))
|
||||
if (!EntityManager.TryGetComponent(args.Used, out GasTankComponent? _))
|
||||
return;
|
||||
|
||||
// Check the user has hands.
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(args.User, out HandsComponent? hands))
|
||||
if (!EntityManager.TryGetComponent(args.User, out HandsComponent? hands))
|
||||
return;
|
||||
|
||||
if (!args.User.InRangeUnobstructed(canister, SharedInteractionSystem.InteractionRange, popup: true))
|
||||
@@ -284,7 +278,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
if (!hands.Drop(args.Used, container))
|
||||
return;
|
||||
|
||||
_adminLogSystem.Add(LogType.CanisterTankInserted, LogImpact.Medium, $"Player {args.User:player} inserted tank {container.ContainedEntities[0]} into {uid}");
|
||||
_adminLogSystem.Add(LogType.CanisterTankInserted, LogImpact.Medium, $"Player {args.User:player} inserted tank {container.ContainedEntities[0]} into {canister}");
|
||||
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user