From 90bbdec455e8d6f3d1742bcd2b4b822950549e3d Mon Sep 17 00:00:00 2001 From: Christian Mesh Date: Fri, 6 Oct 2023 08:21:13 -0400 Subject: [PATCH] Fix atRest with negative forces --- .../immersiverailroading/entity/physics/SimulationState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/cam72cam/immersiverailroading/entity/physics/SimulationState.java b/src/main/java/cam72cam/immersiverailroading/entity/physics/SimulationState.java index 14ac4bb7b..5493539d6 100644 --- a/src/main/java/cam72cam/immersiverailroading/entity/physics/SimulationState.java +++ b/src/main/java/cam72cam/immersiverailroading/entity/physics/SimulationState.java @@ -410,7 +410,7 @@ public double forcesNewtons() { } public boolean atRest() { - return velocity == 0 && forcesNewtons() < frictionNewtons(); + return velocity == 0 && Math.abs(forcesNewtons()) < frictionNewtons(); } public double frictionNewtons() {