Disposals air + new atmos expose event (#6798)

Co-authored-by: Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
This commit is contained in:
mirrorcult
2022-02-19 17:42:01 -07:00
committed by GitHub
parent f23386ac55
commit 3e6bf54727
7 changed files with 77 additions and 5 deletions

View File

@@ -0,0 +1,40 @@
using Content.Server.Atmos.EntitySystems;
using Content.Server.Disposal.Unit.Components;
namespace Content.Server.Disposal.Unit.EntitySystems;
public sealed class BeingDisposedSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<BeingDisposedComponent, InhaleLocationEvent>(OnInhaleLocation);
SubscribeLocalEvent<BeingDisposedComponent, ExhaleLocationEvent>(OnExhaleLocation);
SubscribeLocalEvent<BeingDisposedComponent, AtmosExposedGetAirEvent>(OnGetAir);
}
private void OnGetAir(EntityUid uid, BeingDisposedComponent component, ref AtmosExposedGetAirEvent args)
{
if (TryComp<DisposalHolderComponent>(component.Holder, out var holder))
{
args.Gas = holder.Air;
}
}
private void OnInhaleLocation(EntityUid uid, BeingDisposedComponent component, InhaleLocationEvent args)
{
if (TryComp<DisposalHolderComponent>(component.Holder, out var holder))
{
args.Gas = holder.Air;
}
}
private void OnExhaleLocation(EntityUid uid, BeingDisposedComponent component, ExhaleLocationEvent args)
{
if (TryComp<DisposalHolderComponent>(component.Holder, out var holder))
{
args.Gas = holder.Air;
}
}
}