minor bugfixes
This commit is contained in:
@@ -55,6 +55,7 @@ public class DelayedAction extends Action {
|
||||
public void run() {
|
||||
try {
|
||||
Thread.sleep(delay);
|
||||
LOG.debug("{} ms passed by, firing actions:",delay);
|
||||
} catch (InterruptedException e) {
|
||||
LOG.warn("Interrupted Exception thrown while waiting:",e);
|
||||
}
|
||||
|
||||
@@ -18,11 +18,9 @@ public class SetSpeed extends Action{
|
||||
|
||||
@Override
|
||||
public boolean fire(Context context) {
|
||||
if (context.train != null && context.train.speed > maxSpeed) {
|
||||
context.train.setSpeed(maxSpeed);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if (isNull(context.train)) return false;
|
||||
context.train.setSpeed(maxSpeed);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user