From fbc1493d77dfa8e8a43f8afdf77a9f945613bf54 Mon Sep 17 00:00:00 2001 From: Daniel Kirschten Date: Thu, 16 May 2019 13:57:38 +0200 Subject: [PATCH] Fixed a bug causing new timeline events to not be processed --- LogicUI/src/era/mi/gui/LogicUI.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/LogicUI/src/era/mi/gui/LogicUI.java b/LogicUI/src/era/mi/gui/LogicUI.java index faf5ae4f..1a4b76e4 100644 --- a/LogicUI/src/era/mi/gui/LogicUI.java +++ b/LogicUI/src/era/mi/gui/LogicUI.java @@ -114,10 +114,9 @@ public class LogicUI Simulation.TIMELINE.executeUpTo(System.currentTimeMillis(), System.currentTimeMillis() + 10); long sleepTime; if(Simulation.TIMELINE.hasNext()) - { sleepTime = Simulation.TIMELINE.nextEventTime() - System.currentTimeMillis(); - } else - sleepTime = 100; + else + sleepTime = 10; try { if(sleepTime > 0) @@ -129,7 +128,7 @@ public class LogicUI simulationThread.start(); Simulation.TIMELINE.addEventAddedListener(event -> { - if(event.getTiming() >= System.currentTimeMillis() / (double) 1) + if(event.getTiming() <= System.currentTimeMillis()) simulationThread.interrupt(); }); -- 2.17.1