src/Time/TimeManager.*: fixed bug when transitioning to simple-time.
We need to set _firstUpdate when /sim/time/simple-time/enabled changes to true, otherwise there can be a delay before the FDM carries on.
This commit is contained in:
parent
e62c15cdad
commit
217d612d6a
2 changed files with 7 additions and 1 deletions
|
@ -382,7 +382,12 @@ void TimeManager::computeTimeDeltasSimple(double& simDt, double& realDt)
|
||||||
|
|
||||||
void TimeManager::computeTimeDeltas(double& simDt, double& realDt)
|
void TimeManager::computeTimeDeltas(double& simDt, double& realDt)
|
||||||
{
|
{
|
||||||
if (_simpleTimeEnabled->getBoolValue()) {
|
bool simple_time = _simpleTimeEnabled->getBoolValue();
|
||||||
|
if (simple_time != _simpleTimeEnabledPrev) {
|
||||||
|
_simpleTimeEnabledPrev = simple_time;
|
||||||
|
_firstUpdate = true;
|
||||||
|
}
|
||||||
|
if (simple_time) {
|
||||||
computeTimeDeltasSimple(simDt, realDt);
|
computeTimeDeltasSimple(simDt, realDt);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,6 +128,7 @@ private:
|
||||||
SGPropertyNode_ptr _modelHz;
|
SGPropertyNode_ptr _modelHz;
|
||||||
SGPropertyNode_ptr _timeDelta, _simTimeDelta;
|
SGPropertyNode_ptr _timeDelta, _simTimeDelta;
|
||||||
|
|
||||||
|
bool _simpleTimeEnabledPrev = false;
|
||||||
SGPropertyNode_ptr _simpleTimeEnabled;
|
SGPropertyNode_ptr _simpleTimeEnabled;
|
||||||
SGPropertyNode_ptr _simpleTimeUtc;
|
SGPropertyNode_ptr _simpleTimeUtc;
|
||||||
SGPropertyNode_ptr _simpleTimeFdm;
|
SGPropertyNode_ptr _simpleTimeFdm;
|
||||||
|
|
Loading…
Reference in a new issue