1
0
Fork 0

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:
Julian Smith 2020-09-08 22:52:24 +01:00
parent bdfd42ebd4
commit e2f2299286

View file

@ -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: