From b1395a86ba7e1dbfedc1dfd6ea1db9d981c4d8ca Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 9 Apr 2020 15:48:03 +0100 Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=94disable-hold-short=20option=20fo?= =?UTF-8?q?r=20MP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow explicit disabling of the hold-short behaviour when it causes problems. --- src/Main/options.cxx | 5 ++--- src/Main/positioninit.cxx | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Main/options.cxx b/src/Main/options.cxx index cd7b4d3d6..729bad95f 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -21,9 +21,7 @@ // $Id$ -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include #include @@ -1720,6 +1718,7 @@ struct OptionDesc { {"notrim", false, OPTION_BOOL, "/sim/presets/trim", false, "", 0 }, {"on-ground", false, OPTION_BOOL, "/sim/presets/onground", true, "", 0 }, {"in-air", false, OPTION_BOOL, "/sim/presets/onground", false, "", 0 }, + {"disable-hold-short", false, OPTION_BOOL, "/sim/presets/mp-hold-short-override", true, "", 0 }, {"fog-disable", false, OPTION_STRING, "/sim/rendering/fog", false, "disabled", 0 }, {"fog-fastest", false, OPTION_STRING, "/sim/rendering/fog", false, "fastest", 0 }, {"fog-nicest", false, OPTION_STRING, "/sim/rendering/fog", false, "nicest", 0 }, diff --git a/src/Main/positioninit.cxx b/src/Main/positioninit.cxx index 49bc0d694..42503eee8 100644 --- a/src/Main/positioninit.cxx +++ b/src/Main/positioninit.cxx @@ -180,7 +180,9 @@ std::tuple runwayStartPos(FGRunwayRef runway) double startOffset = fgGetDouble("/sim/airport/runways/start-offset-m", 5.0); SGGeod pos = runway->pointOnCenterline(startOffset); - if (FGIO::isMultiplayerRequested() && (fabs(offsetNm) <0.1)) { + const bool overrideHoldShort = fgGetBool("/sim/presets/mp-hold-short-override", false); + + if (!overrideHoldShort && FGIO::isMultiplayerRequested() && (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");