From 5add2f1f80fe684170156e882068166bf29f667b Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Fri, 24 Sep 2021 08:43:59 +1000 Subject: [PATCH] Fix pullable movement modifier (#4684) --- .../Pulling/Components/SharedPullableComponent.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Content.Shared/Pulling/Components/SharedPullableComponent.cs b/Content.Shared/Pulling/Components/SharedPullableComponent.cs index e7b87b8c53..c32909e896 100644 --- a/Content.Shared/Pulling/Components/SharedPullableComponent.cs +++ b/Content.Shared/Pulling/Components/SharedPullableComponent.cs @@ -47,6 +47,7 @@ namespace Content.Shared.Pulling.Components } var eventBus = Owner.EntityManager.EventBus; + // TODO: JESUS // New value. Abandon being pulled by any existing object. if (_puller != null) @@ -54,6 +55,11 @@ namespace Content.Shared.Pulling.Components var oldPuller = _puller; var oldPullerPhysics = PullerPhysics; + if (_puller.TryGetComponent(out SharedPullerComponent? puller)) + { + puller.Pulling = null; + } + _puller = null; Dirty(); PullerPhysics = null; @@ -67,6 +73,7 @@ namespace Content.Shared.Pulling.Components _physics.WakeBody(); } + // else-branch warning is handled below }