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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
intVec ids;
|
|
||||||
PositionedID runwayId = 0;
|
PositionedID runwayId = 0;
|
||||||
if (gn->getVersion() > 0) {
|
if (gn->getVersion() > 0) {
|
||||||
runwayId = gn->findNearestNodeOnRunway(runwayTakeoff);
|
runwayId = gn->findNearestNodeOnRunway(runwayTakeoff);
|
||||||
|
@ -280,8 +279,9 @@ bool FGAIFlightPlan::createTakeoffTaxi(FGAIAircraft * ac, bool firstFlight,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FGTaxiRoute taxiRoute = gn->findShortestRoute(node, runwayId);
|
FGTaxiRoute taxiRoute;
|
||||||
intVecIterator i;
|
if ( runwayId != 0 )
|
||||||
|
taxiRoute = gn->findShortestRoute(node, runwayId);
|
||||||
|
|
||||||
if (taxiRoute.empty()) {
|
if (taxiRoute.empty()) {
|
||||||
createDefaultTakeoffTaxi(ac, apt, rwy);
|
createDefaultTakeoffTaxi(ac, apt, rwy);
|
||||||
|
@ -383,7 +383,6 @@ bool FGAIFlightPlan::createLandingTaxi(FGAIAircraft * ac, FGAirport * apt,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
intVec ids;
|
|
||||||
PositionedID runwayId = 0;
|
PositionedID runwayId = 0;
|
||||||
if (gn->getVersion() == 1) {
|
if (gn->getVersion() == 1) {
|
||||||
runwayId = gn->findNearestNodeOnRunway(lastWptPos);
|
runwayId = gn->findNearestNodeOnRunway(lastWptPos);
|
||||||
|
@ -393,16 +392,10 @@ bool FGAIFlightPlan::createLandingTaxi(FGAIAircraft * ac, FGAirport * apt,
|
||||||
//cerr << "Using network node " << runwayId << endl;
|
//cerr << "Using network node " << runwayId << endl;
|
||||||
// A negative gateId indicates an overflow parking, use a
|
// A negative gateId indicates an overflow parking, use a
|
||||||
// fallback mechanism for this.
|
// fallback mechanism for this.
|
||||||
// Starting from gate 0 is a bit of a hack...
|
// Starting from gate 0 doesn't work, so don't try it
|
||||||
//FGTaxiRoute route;
|
|
||||||
// delete taxiRoute;
|
|
||||||
// taxiRoute = new FGTaxiRoute;
|
|
||||||
FGTaxiRoute taxiRoute;
|
FGTaxiRoute taxiRoute;
|
||||||
if (gate.isValid())
|
if (gate.isValid())
|
||||||
taxiRoute = gn->findShortestRoute(runwayId, gate.parking()->guid());
|
taxiRoute = gn->findShortestRoute(runwayId, gate.parking()->guid());
|
||||||
else
|
|
||||||
taxiRoute = gn->findShortestRoute(runwayId, 0);
|
|
||||||
intVecIterator i;
|
|
||||||
|
|
||||||
if (taxiRoute.empty()) {
|
if (taxiRoute.empty()) {
|
||||||
createDefaultLandingTaxi(ac, apt);
|
createDefaultLandingTaxi(ac, apt);
|
||||||
|
|
Loading…
Add table
Reference in a new issue