Modified the loop so that the simulation is suspended whenever the user
set the property fdm/jsbsim/simulation/terminate to true.
This commit is contained in:
parent
70c4972f48
commit
45de8ddf80
1 changed files with 6 additions and 1 deletions
|
@ -523,7 +523,12 @@ void FGJSBsim::update( double dt )
|
||||||
trimmed->setBoolValue(false);
|
trimmed->setBoolValue(false);
|
||||||
|
|
||||||
for ( int i=0; i < multiloop; i++ ) {
|
for ( int i=0; i < multiloop; i++ ) {
|
||||||
fdmex->Run();
|
if (!fdmex->Run()) {
|
||||||
|
// The property fdm/jsbsim/simulation/terminate has been set to true
|
||||||
|
// by the user. The sim is considered crashed.
|
||||||
|
crashed = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
update_external_forces(fdmex->GetSimTime() + i * fdmex->GetDeltaT());
|
update_external_forces(fdmex->GetSimTime() + i * fdmex->GetDeltaT());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue