From 609807467343cff4f6d4b7c7425f511797f1f8e8 Mon Sep 17 00:00:00 2001 From: cynical Date: Mon, 30 Dec 2024 21:58:07 -0500 Subject: [PATCH] added over the fix --- Content.Server/Carrying/CarryingSystem.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Content.Server/Carrying/CarryingSystem.cs b/Content.Server/Carrying/CarryingSystem.cs index 72cfeff91d..cf7e37f5c4 100644 --- a/Content.Server/Carrying/CarryingSystem.cs +++ b/Content.Server/Carrying/CarryingSystem.cs @@ -162,11 +162,17 @@ private void OnMobStateChanged(EntityUid uid, CarryingComponent component, MobSt /// private void OnInteractionAttempt(EntityUid uid, BeingCarriedComponent component, InteractionAttemptEvent args) { - if (args.Target == null) + // Floofstation - function body reviewed + Predicate isChildOfCarrier = null!; // C# doesn't have local functions eugh + isChildOfCarrier = (childXForm) => childXForm.ParentUid == component.Carrier + || (childXForm.ParentUid is { Valid: true } parent && isChildOfCarrier(Transform(parent))); + + if (args.Target == null // Allow self-interacts + || isChildOfCarrier(Transform(args.Target.Value))) // Allow interacting with everything on the carriee return; + // Also check if the interacted-with entity is on the carrier and cancel the event if not var targetParent = Transform(args.Target.Value).ParentUid; - if (args.Target.Value != component.Carrier && targetParent != component.Carrier && targetParent != uid) args.Cancel(); } @@ -201,8 +207,9 @@ private void OnStandAttempt(EntityUid uid, BeingCarriedComponent component, Stan private void OnInteractedWith(EntityUid uid, BeingCarriedComponent component, GettingInteractedWithAttemptEvent args) { - if (args.Uid != component.Carrier) - args.Cancel(); + // Floofstation - why. + // if (args.Uid != component.Carrier) + // args.Cancel(); } private void OnPullAttempt(EntityUid uid, BeingCarriedComponent component, PullAttemptEvent args)