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();
|
double topSpeed = train.maxSpeed();
|
||||||
|
|
||||||
if (targetDistance < 10) {
|
if (targetDistance < 10) {
|
||||||
double target = topSpeed * ((targetDistance) / 10);
|
double maxApproachSpeed = topSpeed * ((targetDistance) / 10);
|
||||||
if (target < Math.abs(train.speed)) {
|
double speedRelativeToStation = train.speed * speedMod;
|
||||||
train.speed += (target - Math.abs(train.speed)) * .5f * speedMod;
|
|
||||||
|
if (speedRelativeToStation > maxApproachSpeed) {
|
||||||
|
train.speed += (maxApproachSpeed - Math.abs(train.speed)) * .5f * speedMod;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue