Skip to content

Commit

Permalink
Fix shunting when coupler slack is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
cam72cam committed Sep 15, 2023
1 parent e284ce4 commit 7252012
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public void update() {
double epsilon = 0.000001;
this.currentDistance_M = nextParticle.position_M - prevParticle.position_M;
this.canPush = currentDistance_M - minDistance_M <= epsilon || minDistance_M == maxDistance_M;
this.canPull = coupled && currentDistance_M - maxDistance_M >= -epsilon || minDistance_M == maxDistance_M;
this.canPull = coupled && (currentDistance_M - maxDistance_M >= -epsilon || minDistance_M == maxDistance_M);
if (debug) {
//ImmersiveRailroading.info("min:%s curr:%s max:%s pull:%s push: %s", minDistance_M, currentDistance_M, maxDistance_M, canPull, canPush);
}
Expand Down

0 comments on commit 7252012

Please sign in to comment.