feat: Medbay cryo pods (#11349)
Fixes https://github.com/space-wizards/space-station-14/issues/11245
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using Content.Shared.Standing;
|
||||
using Robust.Shared.Containers;
|
||||
|
||||
namespace Content.Shared.Medical.Cryogenics;
|
||||
|
||||
public abstract partial class SharedCryoPodSystem
|
||||
{
|
||||
public virtual void InitializeInsideCryoPod()
|
||||
{
|
||||
SubscribeLocalEvent<InsideCryoPodComponent, DownAttemptEvent>(HandleDown);
|
||||
SubscribeLocalEvent<InsideCryoPodComponent, EntGotRemovedFromContainerMessage>(OnEntGotRemovedFromContainer);
|
||||
}
|
||||
|
||||
// Must stand in the cryo pod
|
||||
private void HandleDown(EntityUid uid, InsideCryoPodComponent component, DownAttemptEvent args)
|
||||
{
|
||||
args.Cancel();
|
||||
}
|
||||
|
||||
private void OnEntGotRemovedFromContainer(EntityUid uid, InsideCryoPodComponent component, EntGotRemovedFromContainerMessage args)
|
||||
{
|
||||
if (Terminating(uid))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RemComp<InsideCryoPodComponent>(uid);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user