bugfixes
This commit is contained in:
@@ -91,7 +91,7 @@ public class ActionList extends Action implements Iterable<Action>{
|
||||
}
|
||||
|
||||
public boolean fire(Context context) {
|
||||
if (!isEmpty()) LOG.debug(t("Firing {}"),this);
|
||||
if (!isEmpty()) LOG.debug(t("Firing {}"),actions);
|
||||
for (Action action : actions) {
|
||||
if (!action.fire(context)) return false;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ConditionalAction extends ActionList {
|
||||
@Override
|
||||
public boolean fire(Context context) {
|
||||
for (Condition condition : conditions) {
|
||||
if (!condition.fulfilledBy(context)) return false;
|
||||
if (!condition.fulfilledBy(context)) return true; // wenn die Bedingung nicht erfüllt ist, ist das kein Fehler!
|
||||
}
|
||||
return super.fire(context.clone()); // actions, that happen within the conditional action list must not modify the global context.
|
||||
}
|
||||
|
||||
@@ -22,7 +22,9 @@ public class StartStopAuto extends Action {
|
||||
@Override
|
||||
public boolean fire(Context context) {
|
||||
if (isNull(context.train())) return false;
|
||||
context.train().quitAutopilot();
|
||||
if (inverted) {
|
||||
context.train().automatic();
|
||||
} else context.train().quitAutopilot();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user