Remove cryo pod component references (#15247)

This commit is contained in:
DrSmugleaf
2023-04-09 15:28:19 -07:00
committed by GitHub
parent ec28358e06
commit 66adf34f59
8 changed files with 40 additions and 44 deletions

View File

@@ -1,11 +1,10 @@
using Content.Server.Atmos;
using Content.Shared.Atmos;
using Content.Shared.Medical.Cryogenics;
namespace Content.Server.Medical.Components;
[RegisterComponent, ComponentReference(typeof(SharedCryoPodComponent))]
public sealed class CryoPodComponent: SharedCryoPodComponent
[RegisterComponent]
public sealed class CryoPodAirComponent : Component
{
/// <summary>
/// Local air buffer that will be mixed with the pipenet, if one exists, per tick.

View File

@@ -110,7 +110,7 @@ public sealed partial class CryoPodSystem: SharedCryoPodSystem
}
}
public override void EjectBody(EntityUid uid, SharedCryoPodComponent? cryoPodComponent)
public override void EjectBody(EntityUid uid, CryoPodComponent? cryoPodComponent)
{
if (!Resolve(uid, ref cryoPodComponent))
return;
@@ -221,17 +221,24 @@ public sealed partial class CryoPodSystem: SharedCryoPodSystem
if (!nodeContainer.TryGetNode(cryoPod.PortName, out PortablePipeNode? portNode))
return;
_atmosphereSystem.React(cryoPod.Air, portNode);
if (!TryComp(uid, out CryoPodAirComponent? cryoPodAir))
return;
_atmosphereSystem.React(cryoPodAir.Air, portNode);
if (portNode.NodeGroup is PipeNet {NodeCount: > 1} net)
{
_gasCanisterSystem.MixContainerWithPipeNet(cryoPod.Air, net.Air);
_gasCanisterSystem.MixContainerWithPipeNet(cryoPodAir.Air, net.Air);
}
}
private void OnGasAnalyzed(EntityUid uid, CryoPodComponent component, GasAnalyzerScanEvent args)
{
var gasMixDict = new Dictionary<string, GasMixture?> { { Name(uid), component.Air } };
if (!TryComp(uid, out CryoPodAirComponent? cryoPodAir))
return;
var gasMixDict = new Dictionary<string, GasMixture?> { { Name(uid), cryoPodAir.Air } };
// If it's connected to a port, include the port side
if (TryComp(uid, out NodeContainerComponent? nodeContainer))
{

View File

@@ -19,26 +19,26 @@ namespace Content.Server.Medical
private void OnGetAir(EntityUid uid, InsideCryoPodComponent component, ref AtmosExposedGetAirEvent args)
{
if (TryComp<CryoPodComponent>(Transform(uid).ParentUid, out var cryoPodComponent))
if (TryComp<CryoPodAirComponent>(Transform(uid).ParentUid, out var cryoPodAir))
{
args.Gas = cryoPodComponent.Air;
args.Gas = cryoPodAir.Air;
args.Handled = true;
}
}
private void OnInhaleLocation(EntityUid uid, InsideCryoPodComponent component, InhaleLocationEvent args)
{
if (TryComp<CryoPodComponent>(Transform(uid).ParentUid, out var cryoPodComponent))
if (TryComp<CryoPodAirComponent>(Transform(uid).ParentUid, out var cryoPodAir))
{
args.Gas = cryoPodComponent.Air;
args.Gas = cryoPodAir.Air;
}
}
private void OnExhaleLocation(EntityUid uid, InsideCryoPodComponent component, ExhaleLocationEvent args)
{
if (TryComp<CryoPodComponent>(Transform(uid).ParentUid, out var cryoPodComponent))
if (TryComp<CryoPodAirComponent>(Transform(uid).ParentUid, out var cryoPodAir))
{
args.Gas = cryoPodComponent.Air;
args.Gas = cryoPodAir.Air;
}
}