dt can be negative on simulator reset

This commit is contained in:
Oleg Kalachev 2023-12-04 00:27:55 +03:00
parent 94b483cda6
commit c77c25ef4e

View File

@ -7,8 +7,8 @@ void step()
dt = now - t; dt = now - t;
t = now; t = now;
if (isnan(dt)) { if (!(dt > 0)) {
dt = 0; // assume dt to be zero on first step dt = 0; // assume dt to be zero on first step and on reset
} }
computeLoopFreq(); computeLoopFreq();