This commit is contained in:
Stephan Richter
2020-11-27 16:45:02 +01:00
parent dec68728ad
commit d89bd4a364
9 changed files with 27 additions and 22 deletions

View File

@@ -245,7 +245,7 @@ public class Plan extends BaseClass{
Vector<Route> routes = new Vector<Route>();
for (Block block : blocks) {
for (Connector con : block.startPoints()) {
routes.addAll(follow(new Route().begin(block,con.from.inverse()),con));
routes.addAll(follow(new Route().begin(block,con.from),con));
}
}
for (Tile tile : tiles.values()) tile.routes().clear();

View File

@@ -290,7 +290,7 @@ public class Route extends BaseClass implements Comparable<Route>{
path = new Vector<Tile>();
turnouts = new HashMap<>();
startBlock = block;
startDirection = from;
startDirection = from.inverse();
path.add(block);
return this;
}

View File

@@ -598,9 +598,13 @@ public class Train extends BaseClass implements Comparable<Train> {
}
public Object quitAutopilot() {
if (isSet(nextRoute)) {
nextRoute.reset();
nextRoute = null;
}
if (isSet(autopilot)) {
autopilot.stop = true;
autopilot = null;
autopilot = null;
return t("{} stopping at next block.",this);
} else return t("autopilot not active.");
}
@@ -615,7 +619,7 @@ public class Train extends BaseClass implements Comparable<Train> {
boolean error = !nextRoute.lockIgnoring(route);
error = error || !nextRoute.setTurnouts();
error = error || !route.fireSetupActions(context);
error = error || !nextRoute.fireSetupActions(context);
if (error) {
nextRoute.reset(); // may unlock tiles belonging to the current route.