History

Merge branch 'master' of github.com:highfidelity/hifi into use-local-scripts

Seth Alves committed 10 years ago

Commit bb433472 parents 26e01bb b72c28839 files · +471 −238Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 39 files). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+7−4
@@ -673,11 +673,14 @@ void ScriptEngine::run() { · 672 unmodified lines
673673 }
674674
675675 qint64 now = usecTimestampNow();
676− float deltaTime = (float) (now - lastUpdate) / (float) USECS_PER_SECOND;
677676
678− if (!_isFinished) {
679− if (_wantSignals) {
680− emit update(deltaTime);
677+ // we check for 'now' in the past in case people set their clock back
678+ if (lastUpdate < now) {
679+ float deltaTime = (float) (now - lastUpdate) / (float) USECS_PER_SECOND;
680+ if (!_isFinished) {
681+ if (_wantSignals) {
682+ emit update(deltaTime);
683+ }
681684 }
682685 }
683686 lastUpdate = now;