Fixes crit in nograv (#2554)
This commit is contained in:
@@ -49,7 +49,8 @@ namespace Content.Shared.GameObjects.EntitySystems
|
|||||||
base.Shutdown();
|
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>();
|
physics.EnsureController<MoverController>();
|
||||||
|
|
||||||
@@ -70,14 +71,14 @@ namespace Content.Shared.GameObjects.EntitySystems
|
|||||||
// TODO: movement check.
|
// TODO: movement check.
|
||||||
var (walkDir, sprintDir) = mover.VelocityDir;
|
var (walkDir, sprintDir) = mover.VelocityDir;
|
||||||
var combined = walkDir + sprintDir;
|
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))
|
if (physics.TryGetController(out MoverController controller))
|
||||||
{
|
{
|
||||||
controller.StopMoving();
|
controller.StopMoving();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (ActionBlockerSystem.CanMove(mover.Owner))
|
||||||
{
|
{
|
||||||
if (weightless)
|
if (weightless)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user