Fix cryopod interactions (#15045)

This commit is contained in:
Leon Friedrich
2023-04-03 08:30:03 +12:00
committed by GitHub
parent 1bd3e54dae
commit 4e978d54a4
4 changed files with 8 additions and 5 deletions

View File

@@ -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;
}