Fixes crit in nograv (#2554)

This commit is contained in:
GlassEclipse
2020-11-21 21:40:09 -06:00
committed by GitHub
parent 8c81e7c767
commit 1f654df977

View File

@@ -49,7 +49,8 @@ namespace Content.Shared.GameObjects.EntitySystems
base.Shutdown();
}
protected void UpdateKinematics(ITransformComponent transform, IMoverComponent mover, IPhysicsComponent physics)
//TODO: reorganize this to make more logical sense
protected void UpdateKinematics(ITransformComponent transform, IMoverComponent mover, IPhysicsComponent physics)
{
physics.EnsureController<MoverController>();
@@ -70,14 +71,14 @@ namespace Content.Shared.GameObjects.EntitySystems
// TODO: movement check.
var (walkDir, sprintDir) = mover.VelocityDir;
var combined = walkDir + sprintDir;
if (combined.LengthSquared < 0.001 || !ActionBlockerSystem.CanMove(mover.Owner) && !weightless)
if (combined.LengthSquared < 0.001 || !ActionBlockerSystem.CanMove(mover.Owner) && !weightless)
{
if (physics.TryGetController(out MoverController controller))
{
controller.StopMoving();
}
}
else
else if (ActionBlockerSystem.CanMove(mover.Owner))
{
if (weightless)
{