- double lat2 = 0.0, lon2 = 0.0, az2 = 0.0;
-
- //cerr << "Creating final push forward point for gate " << gateId << endl;
- FGTaxiNode *tn = dep->getDynamics()->getGroundNetwork()->findNode(gateId);
- FGTaxiSegmentVectorIterator ts = tn->getBeginRoute();
- FGTaxiSegmentVectorIterator te = tn->getEndRoute();
- if (ts == te) {
- SG_LOG(SG_GENERAL, SG_ALERT, "Gate " << gateId << "doesn't seem to have routes associated with it.");
- //exit(1);
- }
- tn = (*ts)->getEnd();
- lastNodeVisited = tn->getIndex();
- if (tn == NULL) {
- SG_LOG(SG_GENERAL, SG_ALERT, "No valid taxinode found");
- exit(1);
- }
- double distance = (*ts)->getLength();
- cerr << "Length of push forward route = " << distance << " and heading is " << heading << endl;
- lat2 = tn->getLatitude();
- lon2 = tn->getLongitude();
-
- for (int i = 1; i < 10; i++) {
- geo_direct_wgs_84 ( 0, lat, lon, heading,
- ((i / 10.0) * distance), &lat2, &lon2, &az2 );
+ ac->setTaxiClearanceRequest(false);
+ double lat2 = 0.0, lon2 = 0.0, az2 = 0.0;
+
+ //cerr << "Creating final push forward point for gate " << gateId << endl;
+ FGTaxiNode *tn = dep->getDynamics()->getGroundNetwork()->findNode(gateId);
+ FGTaxiSegmentVectorIterator ts = tn->getBeginRoute();
+ FGTaxiSegmentVectorIterator te = tn->getEndRoute();
+ // if the starting node equals the ending node, then there aren't any routes for this parking.
+ // in cases like these we should flag the gate as being inoperative and return false
+ if (ts == te) {
+ SG_LOG(SG_GENERAL, SG_ALERT, "Gate " << gateId << "doesn't seem to have routes associated with it.");
+ parking->setAvailable(false);
+ return false;
+ }
+ tn = (*ts)->getEnd();
+ lastNodeVisited = tn->getIndex();
+ if (tn == NULL) {
+ SG_LOG(SG_GENERAL, SG_ALERT, "No valid taxinode found");
+ exit(1);
+ }
+ double distance = (*ts)->getLength();
+ //cerr << "Length of push forward route = " << distance << " and heading is " << heading << endl;
+ lat2 = tn->getLatitude();
+ lon2 = tn->getLongitude();
+
+ for (int i = 1; i < 10; i++) {
+ geo_direct_wgs_84 ( 0, lat, lon, heading,
+ ((i / 10.0) * distance), &lat2, &lon2, &az2 );