Fix pullable movement modifier (#4684)

This commit is contained in:
metalgearsloth
2021-09-24 08:43:59 +10:00
committed by GitHub
parent 08184bc928
commit 5add2f1f80

View File

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