Remove cryo pod component references (#15247)
This commit is contained in:
@@ -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.
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user