This commit is contained in:
Stephan Richter
2021-03-18 00:57:10 +01:00
parent de19b8594a
commit 9b9c65542c
9 changed files with 27 additions and 25 deletions

View File

@@ -41,9 +41,9 @@ public class BrakeProcess extends BaseClass implements Runnable{
lastSpeed = train.speed;
updateDistance();
if (lastSpeed > targetSpeed) lastSpeed -= 10;
if (lastSpeed < targetSpeed && (ended = true)) lastSpeed = targetSpeed;
if (ended) break;
if (lastSpeed != train.speed) train.setSpeed(lastSpeed);
if (lastSpeed <= targetSpeed && (ended = true)) lastSpeed = targetSpeed;
train.setSpeed(lastSpeed);
}
}