All start from parking position with no ground net
Fix for https://sourceforge.net/p/flightgear/codetickets/2125/ Previously, selecting a non-pushback parking position from the l auncher that did not have a ground network resulted in the aircraft being placed in the center of the airport. This resolves the problem by creating a default segment simply moving forward 2m.
This commit is contained in:
parent
df352346ad
commit
1d1096d6f7
1 changed files with 41 additions and 33 deletions
|
@ -135,12 +135,20 @@ bool FGAIFlightPlan::createPushBack(FGAIAircraft *ac,
|
|||
double az2 = 0.0;
|
||||
|
||||
FGTaxiSegment* pushForwardSegment = dep->groundNetwork()->findSegment(parking, 0);
|
||||
// there aren't any routes for this parking.
|
||||
if (!pushForwardSegment) {
|
||||
// there aren't any routes for this parking, so create a simple segment straight ahead for 2 meters based on the parking heading
|
||||
SG_LOG(SG_AI, SG_DEV_WARN, "Gate " << parking->ident() << "/" << parking->getName()
|
||||
<< " at " << dep->getId()
|
||||
<< " doesn't seem to have routes associated with it.");
|
||||
return false;
|
||||
|
||||
FGAIWaypoint *wpt = createOnGround(ac, string("park"), dep->geod(), dep->getElevation(), vTaxiReduced);
|
||||
pushBackWaypoint(wpt);
|
||||
|
||||
SGGeod coord;
|
||||
SGGeodesy::direct(dep->geod(), parking->getHeading(), 2.0, coord, az2);
|
||||
wpt = createOnGround(ac, string("taxiStart"), coord, dep->getElevation(), vTaxiReduced);
|
||||
pushBackWaypoint(wpt);
|
||||
return true;
|
||||
}
|
||||
|
||||
lastNodeVisited = pushForwardSegment->getEnd();
|
||||
|
|
Loading…
Add table
Reference in a new issue