From 4928886e562c04bf8a8497a6b4f70aba793e20c2 Mon Sep 17 00:00:00 2001 From: Durk Talsma Date: Mon, 1 Aug 2011 21:34:33 +0200 Subject: [PATCH] Bugfix: Change the point where leg numbers recycle, in order to avoid hitting the default case in AIFlightPlan::create(). --- src/AIModel/AIAircraft.cxx | 4 ++-- src/AIModel/AIFlightPlanCreate.cxx | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/AIModel/AIAircraft.cxx b/src/AIModel/AIAircraft.cxx index 9d630d683..30b7cf9d3 100644 --- a/src/AIModel/AIAircraft.cxx +++ b/src/AIModel/AIAircraft.cxx @@ -413,12 +413,12 @@ const char * FGAIAircraft::_getTransponderCode() const { bool FGAIAircraft::loadNextLeg(double distance) { int leg; - if ((leg = fp->getLeg()) == 10) { + if ((leg = fp->getLeg()) == 9) { if (!trafficRef->next()) { return false; } setCallSign(trafficRef->getCallSign()); - leg = 1; + leg = 0; fp->setLeg(leg); } diff --git a/src/AIModel/AIFlightPlanCreate.cxx b/src/AIModel/AIFlightPlanCreate.cxx index e438ac4d1..884bf25b6 100644 --- a/src/AIModel/AIFlightPlanCreate.cxx +++ b/src/AIModel/AIFlightPlanCreate.cxx @@ -821,6 +821,7 @@ bool FGAIFlightPlan::createDescent(FGAIAircraft * ac, FGAirport * apt, //cerr << "Repositioning to waypoint " << (*waypoints.begin())->name << endl; ac->resetPositionFromFlightPlan(); } + waypoints[1]->setName( (waypoints[1]->getName() + string("legend"))); return true; }