bugfixes
This commit is contained in:
@@ -82,10 +82,6 @@ public class ActionList extends Action implements Iterable<Action>{
|
||||
|
||||
public boolean fire(Context context,Object cause) {
|
||||
for (Action action : actions) {
|
||||
if (context.invalidated()) {
|
||||
LOG.debug("Context has been invalidated, aborting {}",this);
|
||||
return false;
|
||||
}
|
||||
LOG.debug("firing \"{}\"",action);
|
||||
if (!action.fire(context,cause)) {
|
||||
LOG.warn("{} failed",action);
|
||||
|
||||
@@ -13,6 +13,7 @@ public class PreserveRoute extends Action {
|
||||
|
||||
@Override
|
||||
public boolean fire(Context context,Object cause) {
|
||||
if (context.invalidated()) return false;
|
||||
Train train = context.train();
|
||||
Route route = context.route();
|
||||
// These are errors:
|
||||
|
||||
@@ -35,6 +35,7 @@ public class SetSignal extends Action {
|
||||
|
||||
@Override
|
||||
public boolean fire(Context context,Object cause) {
|
||||
if (context.invalidated()) return false;
|
||||
if (isNull(signal)) return false;
|
||||
return signal.state(state);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ public class SetSpeed extends Action{
|
||||
|
||||
@Override
|
||||
public boolean fire(Context context,Object cause) {
|
||||
if (context.invalidated()) return false;
|
||||
if (isNull(context.train())) return false;
|
||||
context.train().setSpeed(speed);
|
||||
return true;
|
||||
|
||||
@@ -26,6 +26,7 @@ public class SetTurnout extends Action {
|
||||
|
||||
@Override
|
||||
public boolean fire(Context context,Object cause) {
|
||||
if (context.invalidated()) return false;
|
||||
if (isNull(turnout)) return false;
|
||||
if (!turnout.state(state).succeeded()) return false;
|
||||
if (turnout.address() == 0) return true;
|
||||
|
||||
Reference in New Issue
Block a user