From d975a417fc926c7db386f1d44ea6354682ad0d02 Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 7 Sep 2016 22:51:08 +0100 Subject: [PATCH] Fix setting start offset with MP enabled. --- src/Main/positioninit.cxx | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/Main/positioninit.cxx b/src/Main/positioninit.cxx index ddc789c6e..4f854c172 100644 --- a/src/Main/positioninit.cxx +++ b/src/Main/positioninit.cxx @@ -165,9 +165,10 @@ static void fgApplyStartOffset(const SGGeod& aStartPos, double aHeading, double boost::tuple runwayStartPos(FGRunwayRef runway) { fgSetString("/sim/atc/runway", runway->ident().c_str()); + double offsetNm = fgGetDouble("/sim/presets/offset-distance-nm"); - if (isMPEnabled()) { - SG_LOG( SG_GENERAL, SG_INFO, "Requested to start on " << runway->airport()->ident() << "/" << + if (isMPEnabled() && (fabs(offsetNm) <0.1)) { + SG_LOG( SG_GENERAL, SG_WARN, "Requested to start on " << runway->airport()->ident() << "/" << runway->ident() << ", MP is enabled so computing hold short position to avoid runway incursion"); // set this so multiplayer.nas can inform the user @@ -209,14 +210,8 @@ static bool setPosFromAirportIDandHdg( const string& id, double tgt_hdg ) { boost::tie(startPos, heading) = runwayStartPos(r); } - if (isMPEnabled()) { - // don't permit offsetting when MP is enabled - setInitialPosition(startPos, heading); - } else { - fgApplyStartOffset(startPos, heading); - } - - return true; + fgApplyStartOffset(startPos, heading); + return true; } // Set current_options lon/lat given an airport id and parkig position name @@ -330,13 +325,7 @@ static bool fgSetPosFromAirportIDandRwy( const string& id, const string& rwy, bo SGGeod startPos; double heading; boost::tie(startPos, heading) = runwayStartPos(r); - - if (isMPEnabled()) { - // don't permit offsetting when MP is enabled - setInitialPosition(startPos, heading); - } else { - fgApplyStartOffset(startPos, heading); - } + fgApplyStartOffset(startPos, heading); return true; } else if (apt->hasHelipadWithIdent(rwy)) { FGHelipad* h(apt->getHelipadByIdent(rwy)); -- 2.39.5