This commit is contained in:
Stephan Richter
2020-12-04 00:56:14 +01:00
parent a45080ca88
commit 237b4e1f8f
4 changed files with 6 additions and 4 deletions

View File

@@ -105,7 +105,9 @@ public class Route extends BaseClass implements Comparable<Route>{
train.setSpeed(0);
if (aborted) return;
long runtime = timestamp2 - timestamp;
int newTimeStep = 5*(int) runtime/(startSpeed - ENDSPEED);
int quotient = startSpeed - ENDSPEED;
if (quotient<1) quotient = 1;
int newTimeStep = 5*(int) runtime/quotient;
int diff = newTimeStep - timeStep;
int absDiff = diff < 0 ? -diff : diff;

View File

@@ -754,8 +754,8 @@ public class Train extends BaseClass implements Comparable<Train> {
nextRoute = null;
}
if (isSet(route)) {
route.reset();
route.brakeCancel();
route.reset();
route = null;
}

View File

@@ -37,7 +37,7 @@ public abstract class StretchableTile extends Tile {
@Override
protected Window properties(List<Fieldset> preForm, FormInput formInputs, List<Fieldset> postForm) {
formInputs.add(stretchType(),new Input(STRETCH_LENGTH, stretch).addTo(new Tag("span")).content(NBSP+t("Tile(s)")));
formInputs.add(stretchType(),new Input(STRETCH_LENGTH, stretch).numeric().addTo(new Tag("span")).content(NBSP+t("Tile(s)")));
return super.properties(preForm, formInputs, postForm);
}