Gas tank internals alerts (#9567)

This commit is contained in:
metalgearsloth
2022-07-25 14:42:25 +10:00
committed by GitHub
parent dad26db137
commit 40a7584c2f
25 changed files with 570 additions and 354 deletions

View File

@@ -0,0 +1,30 @@
using Content.Server.Atmos.Components;
using Content.Server.Body.Components;
namespace Content.Server.Atmos.EntitySystems;
public sealed partial class AtmosphereSystem
{
private void InitializeBreathTool()
{
SubscribeLocalEvent<BreathToolComponent, ComponentShutdown>(OnBreathToolShutdown);
}
private void OnBreathToolShutdown(EntityUid uid, BreathToolComponent component, ComponentShutdown args)
{
DisconnectInternals(component);
}
public void DisconnectInternals(BreathToolComponent component)
{
var old = component.ConnectedInternalsEntity;
component.ConnectedInternalsEntity = null;
if (TryComp<InternalsComponent>(old, out var internalsComponent))
{
_internals.DisconnectBreathTool(internalsComponent);
}
component.IsFunctional = false;
}
}