From f993684f959c89d6c0fe810f7d5c216291949ef0 Mon Sep 17 00:00:00 2001 From: JoePfeiffer Date: Tue, 9 Aug 2022 19:33:53 -0600 Subject: [PATCH] If we don't have any events left in the queue, shouldn't advance time --- .../sf/openrocket/simulation/BasicEventSimulationEngine.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java b/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java index 1d5b62e76..0ba86fb4c 100644 --- a/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java +++ b/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java @@ -130,8 +130,8 @@ public class BasicEventSimulationEngine implements SimulationEngine { double oldAlt = currentStatus.getRocketPosition().z; if (SimulationListenerHelper.firePreStep(currentStatus)) { - // Step at most to the next event - double maxStepTime = Double.MAX_VALUE; + // Step at most to the next event. If there is no next event, don't step time + double maxStepTime = 0.0; FlightEvent nextEvent = currentStatus.getEventQueue().peek(); if (nextEvent != null) { maxStepTime = MathUtil.max(nextEvent.getTime() - currentStatus.getSimulationTime(), 0.001);