src/Main/positioninit.cxx: open popup if we can't find taxiway to avoid starting on runway.
This commit is contained in:
parent
fd723c0497
commit
d34f7dc451
1 changed files with 19 additions and 11 deletions
|
@ -191,18 +191,26 @@ std::tuple<SGGeod, double> runwayStartPos(FGRunwayRef runway)
|
||||||
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");
|
||||||
|
|
||||||
FGGroundNetwork* groundNet = runway->airport()->groundNetwork();
|
FGGroundNetwork* groundNet = runway->airport()->groundNetwork();
|
||||||
// add a margin, try to keep the entire aeroplane comfortable off the
|
|
||||||
// runway.
|
if (groundNet) {
|
||||||
double margin = startOffset + (runway->widthM() * 1.5);
|
// add a margin, try to keep the entire aeroplane comfortable off the
|
||||||
FGTaxiNodeRef taxiNode = groundNet ? groundNet->findNearestNodeOffRunway(pos, runway, margin) : FGTaxiNodeRef{};
|
// runway.
|
||||||
if (taxiNode) {
|
double margin = startOffset + (runway->widthM() * 1.5);
|
||||||
// set this so multiplayer.nas can inform the user
|
FGTaxiNodeRef taxiNode = groundNet->findNearestNodeOffRunway(pos, runway, margin);
|
||||||
fgSetBool("/sim/presets/avoided-mp-runway", true);
|
if (taxiNode) {
|
||||||
return std::make_tuple(taxiNode->geod(), SGGeodesy::courseDeg(taxiNode->geod(), pos));
|
// set this so multiplayer.nas can inform the user
|
||||||
|
fgSetBool("/sim/presets/avoided-mp-runway", true);
|
||||||
|
return std::make_tuple(taxiNode->geod(), SGGeodesy::courseDeg(taxiNode->geod(), pos));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// if we couldn't find a suitable taxi-node, give up. Guessing a position
|
||||||
|
// causes too much pain (starting in the water or similar bad things)
|
||||||
|
SG_LOG( SG_GENERAL, SG_POPUP, "Unable to position off runway because groundnet has no taxi node.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
SG_LOG( SG_GENERAL, SG_POPUP, "Unable to position off runway because no groundnet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we couldn't find a suitable taxi-node, give up. Guessing a position
|
|
||||||
// causes too much pain (starting in the water or similar bad things)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::make_tuple(pos, runway->headingDeg());
|
return std::make_tuple(pos, runway->headingDeg());
|
||||||
|
|
Loading…
Add table
Reference in a new issue