if(startBlock.train()==train&&!train.onTrace(startBlock))startBlock.setTrain(null);// withdraw train from start block only if trace does not go back there
}
train=null;
@ -888,7 +888,7 @@ public class Route extends BaseClass {
@@ -888,7 +888,7 @@ public class Route extends BaseClass {
if(isSet(train)){
train.set(startBlock);
train.heading(startDirection);
if(train.route==this)train.route=null;
if(train.route()==this)train.route(null);
train=null;
}
LOG.debug("chlearing triggeredContacts of {}",this);
@ -1021,6 +1021,7 @@ public class Route extends BaseClass {
@@ -1021,6 +1021,7 @@ public class Route extends BaseClass {
@ -127,7 +127,7 @@ public class Locomotive extends Car implements Constants,Device{
@@ -127,7 +127,7 @@ public class Locomotive extends Car implements Constants,Device{
@ -127,16 +127,19 @@ public abstract class Tile extends BaseClass implements Comparable<Tile>{
@@ -127,16 +127,19 @@ public abstract class Tile extends BaseClass implements Comparable<Tile>{
}
if(isSet(route)){
PathFinder.LOG.debug("{} is occupied by {}",this,route);
returnfalse;
returnfalse;
}
}
if(isSet(train)){
booleanfree=train==context.train();// during train.reserveNext, we may encounter, parts, that are already reserved by the respective train, but having another route. do not compare routes in that case!
TraincontextTrain=context.train();
booleanfree=train==contextTrain;// during train.reserveNext, we may encounter, parts, that are already reserved by the respective train, but having another route. do not compare routes in that case!
if(free){
PathFinder.LOG.debug("already reserved by {} → true",train);
}else{
PathFinder.LOG.debug("occupied by {} → false",train);