If we don't have any events left in the queue, shouldn't advance time
This commit is contained in:
parent
e70b737fe1
commit
f993684f95
@ -130,8 +130,8 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
double oldAlt = currentStatus.getRocketPosition().z;
|
double oldAlt = currentStatus.getRocketPosition().z;
|
||||||
|
|
||||||
if (SimulationListenerHelper.firePreStep(currentStatus)) {
|
if (SimulationListenerHelper.firePreStep(currentStatus)) {
|
||||||
// Step at most to the next event
|
// Step at most to the next event. If there is no next event, don't step time
|
||||||
double maxStepTime = Double.MAX_VALUE;
|
double maxStepTime = 0.0;
|
||||||
FlightEvent nextEvent = currentStatus.getEventQueue().peek();
|
FlightEvent nextEvent = currentStatus.getEventQueue().peek();
|
||||||
if (nextEvent != null) {
|
if (nextEvent != null) {
|
||||||
maxStepTime = MathUtil.max(nextEvent.getTime() - currentStatus.getSimulationTime(), 0.001);
|
maxStepTime = MathUtil.max(nextEvent.getTime() - currentStatus.getSimulationTime(), 0.001);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user