src/Main/options.cxx:fgOptLoadTape(): call fgOSExit() if we fail to load tape.
If user specified --load-tape then failure to load it should be fatal to avoid confusion. It also avoids needlessly overwriting a valid recovery tape if /sim/replay/recovery-period is set.
This commit is contained in:
parent
bdfd42ebd4
commit
e2f2299286
1 changed files with 7 additions and 2 deletions
|
@ -68,6 +68,7 @@
|
|||
#include <Navaids/NavDataCache.hxx>
|
||||
#include "globals.hxx"
|
||||
#include "fg_init.hxx"
|
||||
#include "fg_os.hxx"
|
||||
#include "fg_props.hxx"
|
||||
#include "options.hxx"
|
||||
#include "util.hxx"
|
||||
|
@ -1587,8 +1588,12 @@ fgOptLoadTape(const char* arg)
|
|||
SGPropertyNode_ptr arg = new SGPropertyNode();
|
||||
arg->setStringValue("tape", _tape.utf8Str() );
|
||||
arg->setBoolValue( "same-aircraft", 0 );
|
||||
replay->loadTape(arg);
|
||||
|
||||
if (!replay->loadTape(arg)) {
|
||||
// Force shutdown.
|
||||
SG_LOG(SG_GENERAL, SG_POPUP, "Exiting because unable to load fgtape: " << _tape.str());
|
||||
flightgear::modalMessageBox("Exiting because unable to load fgtape", _tape.str(), "");
|
||||
fgOSExit(1);
|
||||
}
|
||||
delete this; // commence suicide
|
||||
}
|
||||
private:
|
||||
|
|
Loading…
Add table
Reference in a new issue