From: daveluff Date: Fri, 5 Mar 2004 12:34:08 +0000 (+0000) Subject: Fix a crash that sometimes occurred when reporting downwind in the circuit X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f8ef6d16b4b80fb7202846590d8709bb1b7344fd;p=flightgear.git Fix a crash that sometimes occurred when reporting downwind in the circuit --- diff --git a/src/ATC/tower.cxx b/src/ATC/tower.cxx index ea90860eb..cd388f4dc 100644 --- a/src/ATC/tower.cxx +++ b/src/ATC/tower.cxx @@ -2036,11 +2036,16 @@ void FGTower::ReportDownwind(string ID) { // the moment that would b&gg?r up the constraint position calculations. RemoveFromAppList(ID); t->leg = DOWNWIND; - t->pos = t->planePtr->GetPos(); + if(t->isUser) { + t->pos.setlon(user_lon_node->getDoubleValue()); + t->pos.setlat(user_lat_node->getDoubleValue()); + t->pos.setelev(user_elev_node->getDoubleValue()); + } else { + // ASSERT(t->planePtr != NULL); + t->pos = t->planePtr->GetPos(); + } CalcETA(t); - //cout << "DDDDDDDDDDDDDDDDdddddddd" << endl; AddToCircuitList(t); - //cout << "EEEEEEEEEEEEEEEEEEEEeeeeee" << endl; } else { SG_LOG(SG_ATC, SG_WARN, "WARNING: Unable to find plane " << ID << " in FGTower::ReportDownwind(...)"); }