mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 08:36:52 +08:00
Fall back to observer mode login in case no simulator is available
refs #860
This commit is contained in:
committed by
Mathew Sutcliffe
parent
f5058574d0
commit
372e92072c
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user