minor bugfix. next step: implementing the preserveNextRoute action.

Must work in the following conditions:
- called from route.setupActions
- called from route.startActions
- called from route.contactActions
- called from autopilot after reaching route.endBlock
This commit is contained in:
Stephan Richter
2021-03-14 20:07:36 +01:00
parent 3c53bd192f
commit fd254db358
3 changed files with 6 additions and 5 deletions

View File

@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.srsoftware</groupId>
<artifactId>web4rail</artifactId>
<version>1.3.69</version>
<version>1.3.70</version>
<name>Web4Rail</name>
<packaging>jar</packaging>
<description>Java Model Railway Control</description>

View File

@@ -30,7 +30,7 @@ public class PreserveRoute extends Action {
return false; // train is expected to wait in next block.
}
train.reserveNext();
train.reserveRouteAfter(route);
return true;
}
}

View File

@@ -715,10 +715,10 @@ public class Train extends BaseClass implements Comparable<Train> {
return tags().iterator();
}
public void reserveNext() {
LOG.debug("{}.reserveNext()",this);
public void reserveRouteAfter(Route r) {
LOG.debug("reserveRouteAfter({})",r);
}
/**
* This turns the train as if it went through a loop. Example:
* before: CabCar→ MiddleCar→ Loco→
@@ -886,6 +886,7 @@ public class Train extends BaseClass implements Comparable<Train> {
if (trace.contains(tile)) stuckTrace.add(tile);
}
route.reset();
route = null;
}
return properties();
}