Fixes crit in nograv (#2554)
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user