minor improvement

This commit is contained in:
Stephan Richter
2021-03-30 23:41:53 +02:00
parent 0dde9693d1
commit 2967e3b762
2 changed files with 6 additions and 3 deletions

View File

@@ -839,8 +839,11 @@ public class Train extends BaseClass implements Comparable<Train> {
public Train reverse() {
LOG.debug("train.reverse();");
if (isSet(direction)) direction = direction.inverse();
if (isSet(currentBlock)) plan.place(currentBlock);
if (isSet(direction)) direction = direction.inverse();
if (isSet(currentBlock)) {
if (isNull(direction)) direction = currentBlock.directionA();
plan.place(currentBlock);
}
return this;
}