projects
/
simgear.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac84115
)
Fix negative loop counts when dt is small.
author
James Turner
<zakalawe@mac.com>
Wed, 6 Jan 2016 05:18:41 +0000
(23:18 -0600)
committer
James Turner
<zakalawe@mac.com>
Wed, 6 Jan 2016 05:18:41 +0000
(23:18 -0600)
simgear/structure/subsystem_mgr.cxx
patch
|
blob
|
history
diff --git
a/simgear/structure/subsystem_mgr.cxx
b/simgear/structure/subsystem_mgr.cxx
index 5e26a4320fbb305aa28cf5f02561d31df4c23c9d..b01a0ffe05831c463158a3b7813b36b2c28abc3b 100644
(file)
--- a/
simgear/structure/subsystem_mgr.cxx
+++ b/
simgear/structure/subsystem_mgr.cxx
@@
-234,6
+234,7
@@
SGSubsystemGroup::update (double delta_time_sec)
if ((delta_time_sec > 0.0) && (_fixedUpdateTime > 0.0)) {
double localDelta = delta_time_sec + _updateTimeRemainder;
loopCount = SGMiscd::roundToInt(localDelta / _fixedUpdateTime);
+ loopCount = std::max(0, loopCount);
_updateTimeRemainder = delta_time_sec - (loopCount * _fixedUpdateTime);
delta_time_sec = _fixedUpdateTime;
}