Fix cryopod interactions (#15045)
This commit is contained in:
@@ -3,5 +3,5 @@ using Content.Shared.Medical.Cryogenics;
|
||||
|
||||
namespace Content.Client.Medical.Cryogenics;
|
||||
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, ComponentReference(typeof(SharedCryoPodComponent))]
|
||||
public sealed class CryoPodComponent : SharedCryoPodComponent { }
|
||||
|
||||
@@ -4,7 +4,7 @@ using Content.Shared.Medical.Cryogenics;
|
||||
|
||||
namespace Content.Server.Medical.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, ComponentReference(typeof(SharedCryoPodComponent))]
|
||||
public sealed class CryoPodComponent: SharedCryoPodComponent
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -53,7 +53,6 @@ public sealed partial class CryoPodSystem: SharedCryoPodSystem
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<CryoPodComponent, CanDropTargetEvent>(OnCryoPodCanDropOn);
|
||||
SubscribeLocalEvent<CryoPodComponent, ComponentInit>(OnComponentInit);
|
||||
SubscribeLocalEvent<CryoPodComponent, GetVerbsEvent<AlternativeVerb>>(AddAlternativeVerbs);
|
||||
SubscribeLocalEvent<CryoPodComponent, GotEmaggedEvent>(OnEmagged);
|
||||
|
||||
@@ -26,12 +26,16 @@ public abstract partial class SharedCryoPodSystem: EntitySystem
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<SharedCryoPodComponent, CanDropTargetEvent>(OnCryoPodCanDropOn);
|
||||
InitializeInsideCryoPod();
|
||||
}
|
||||
|
||||
protected void OnCryoPodCanDropOn(EntityUid uid, SharedCryoPodComponent component, ref CanDropTargetEvent args)
|
||||
private void OnCryoPodCanDropOn(EntityUid uid, SharedCryoPodComponent component, ref CanDropTargetEvent args)
|
||||
{
|
||||
args.CanDrop = args.CanDrop && HasComp<BodyComponent>(args.Dragged);
|
||||
if (args.Handled)
|
||||
return;
|
||||
|
||||
args.CanDrop = HasComp<BodyComponent>(args.Dragged);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user