Fix "Error in ground network. Failed to find first waypoint"
Fix provided by Jens Thoms Toerring, OK'ed from Durk http://thread.gmane.org/gmane.games.flightgear.devel/77674
This commit is contained in:
parent
1933b71729
commit
92e6e25d33
1 changed files with 4 additions and 11 deletions
|
@ -247,7 +247,6 @@ bool FGAIFlightPlan::createTakeoffTaxi(FGAIAircraft * ac, bool firstFlight,
|
|||
return true;
|
||||
}
|
||||
|
||||
intVec ids;
|
||||
PositionedID runwayId = 0;
|
||||
if (gn->getVersion() > 0) {
|
||||
runwayId = gn->findNearestNodeOnRunway(runwayTakeoff);
|
||||
|
@ -280,8 +279,9 @@ bool FGAIFlightPlan::createTakeoffTaxi(FGAIAircraft * ac, bool firstFlight,
|
|||
}
|
||||
}
|
||||
|
||||
FGTaxiRoute taxiRoute = gn->findShortestRoute(node, runwayId);
|
||||
intVecIterator i;
|
||||
FGTaxiRoute taxiRoute;
|
||||
if ( runwayId != 0 )
|
||||
taxiRoute = gn->findShortestRoute(node, runwayId);
|
||||
|
||||
if (taxiRoute.empty()) {
|
||||
createDefaultTakeoffTaxi(ac, apt, rwy);
|
||||
|
@ -383,7 +383,6 @@ bool FGAIFlightPlan::createLandingTaxi(FGAIAircraft * ac, FGAirport * apt,
|
|||
return true;
|
||||
}
|
||||
|
||||
intVec ids;
|
||||
PositionedID runwayId = 0;
|
||||
if (gn->getVersion() == 1) {
|
||||
runwayId = gn->findNearestNodeOnRunway(lastWptPos);
|
||||
|
@ -393,16 +392,10 @@ bool FGAIFlightPlan::createLandingTaxi(FGAIAircraft * ac, FGAirport * apt,
|
|||
//cerr << "Using network node " << runwayId << endl;
|
||||
// A negative gateId indicates an overflow parking, use a
|
||||
// fallback mechanism for this.
|
||||
// Starting from gate 0 is a bit of a hack...
|
||||
//FGTaxiRoute route;
|
||||
// delete taxiRoute;
|
||||
// taxiRoute = new FGTaxiRoute;
|
||||
// Starting from gate 0 doesn't work, so don't try it
|
||||
FGTaxiRoute taxiRoute;
|
||||
if (gate.isValid())
|
||||
taxiRoute = gn->findShortestRoute(runwayId, gate.parking()->guid());
|
||||
else
|
||||
taxiRoute = gn->findShortestRoute(runwayId, 0);
|
||||
intVecIterator i;
|
||||
|
||||
if (taxiRoute.empty()) {
|
||||
createDefaultLandingTaxi(ac, apt);
|
||||
|
|
Loading…
Add table
Reference in a new issue