Fall back to observer mode login in case no simulator is available

refs #860
This commit is contained in:
Roland Winklmeier
2017-01-16 14:37:06 +01:00
committed by Mathew Sutcliffe
parent f5058574d0
commit 372e92072c
2 changed files with 8 additions and 1 deletions

View File

@@ -179,6 +179,14 @@ namespace BlackCore
this->getIContextOwnAircraft()->updateOwnAircraftPilot(server.getUser());
const CSimulatedAircraft ownAircraft(this->ownAircraft());
this->m_network->presetServer(server);
// Fall back to observer mode, if no simulator is available or not simulating
if(!this->getIContextSimulator()->isSimulatorSimulating())
{
CLogMessage(this).info("No simulator connected or connected simulator not simulating. Falling back to observer mode");
mode = INetwork::LoginAsObserver;
}
this->m_network->presetLoginMode(mode);
this->m_network->presetCallsign(ownAircraft.getCallsign());
this->m_network->presetIcaoCodes(ownAircraft);