1
0
Fork 0

Add —disable-hold-short option for MP

Allow explicit disabling of the hold-short behaviour when it causes
problems.
This commit is contained in:
James Turner 2020-04-09 15:48:03 +01:00
parent b8f28d54c6
commit b1395a86ba
2 changed files with 5 additions and 4 deletions

View file

@ -21,9 +21,7 @@
// $Id$ // $Id$
#ifdef HAVE_CONFIG_H #include <config.h>
# include <config.h>
#endif
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <simgear/structure/exception.hxx> #include <simgear/structure/exception.hxx>
@ -1720,6 +1718,7 @@ struct OptionDesc {
{"notrim", false, OPTION_BOOL, "/sim/presets/trim", false, "", 0 }, {"notrim", false, OPTION_BOOL, "/sim/presets/trim", false, "", 0 },
{"on-ground", false, OPTION_BOOL, "/sim/presets/onground", true, "", 0 }, {"on-ground", false, OPTION_BOOL, "/sim/presets/onground", true, "", 0 },
{"in-air", false, OPTION_BOOL, "/sim/presets/onground", false, "", 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-disable", false, OPTION_STRING, "/sim/rendering/fog", false, "disabled", 0 },
{"fog-fastest", false, OPTION_STRING, "/sim/rendering/fog", false, "fastest", 0 }, {"fog-fastest", false, OPTION_STRING, "/sim/rendering/fog", false, "fastest", 0 },
{"fog-nicest", false, OPTION_STRING, "/sim/rendering/fog", false, "nicest", 0 }, {"fog-nicest", false, OPTION_STRING, "/sim/rendering/fog", false, "nicest", 0 },

View file

@ -180,7 +180,9 @@ std::tuple<SGGeod, double> runwayStartPos(FGRunwayRef runway)
double startOffset = fgGetDouble("/sim/airport/runways/start-offset-m", 5.0); double startOffset = fgGetDouble("/sim/airport/runways/start-offset-m", 5.0);
SGGeod pos = runway->pointOnCenterline(startOffset); 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() << "/" << 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"); runway->ident() << ", MP is enabled so computing hold short position to avoid runway incursion");