Predict dumping (#32394)
* Predict dumping - This got soaped really fucking hard. - Dumping is predicted, this required disposals to be predicte.d - Disposals required mailing (because it's tightly coupled), and a smidge of other content systems. - I also had to fix a compnetworkgenerator issue at the same time so it wouldn't mispredict. * Fix a bunch of stuff * nasty merge * Some reviews * Some more reviews while I stash * Fix merge * Fix merge * Half of review * Review * re(h)f * lizards * feexes * feex
This commit is contained in:
41
Content.Server/Disposal/Unit/BeingDisposedSystem.cs
Normal file
41
Content.Server/Disposal/Unit/BeingDisposedSystem.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Server.Body.Systems;
|
||||
|
||||
namespace Content.Server.Disposal.Unit;
|
||||
|
||||
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;
|
||||
args.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user