mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-02-05 01:45:00 +01:00
Backwards Approach
- Fixed trains acceleration edge case at low speed settings #6348
This commit is contained in:
parent
067062ca62
commit
3d84836422
1 changed files with 5 additions and 3 deletions
|
@ -264,9 +264,11 @@ public class Navigation {
|
|||
double topSpeed = train.maxSpeed();
|
||||
|
||||
if (targetDistance < 10) {
|
||||
double target = topSpeed * ((targetDistance) / 10);
|
||||
if (target < Math.abs(train.speed)) {
|
||||
train.speed += (target - Math.abs(train.speed)) * .5f * speedMod;
|
||||
double maxApproachSpeed = topSpeed * ((targetDistance) / 10);
|
||||
double speedRelativeToStation = train.speed * speedMod;
|
||||
|
||||
if (speedRelativeToStation > maxApproachSpeed) {
|
||||
train.speed += (maxApproachSpeed - Math.abs(train.speed)) * .5f * speedMod;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue