X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FATC%2FAIMgr.cxx;h=629d5d97b09f1d4db7c36233c7c64d5a93d011ec;hb=68f248879cb15562c7b026445f83caf8f2842ae9;hp=50662f547952809e3b188ae3cf0dc88bd89eba26;hpb=e2a170c7d4814c98fa85c3b59e841e8b5ca7ecff;p=flightgear.git diff --git a/src/ATC/AIMgr.cxx b/src/ATC/AIMgr.cxx index 50662f547..629d5d97b 100644 --- a/src/ATC/AIMgr.cxx +++ b/src/ATC/AIMgr.cxx @@ -75,7 +75,7 @@ void FGAIMgr::init() { // Load up models at the start to avoid pausing later // Hack alert - Hardwired paths!! - string planepath = "Aircraft/c172/Models/c172-dpm.ac"; + string planepath = "Aircraft/c172r/Models/c172-dpm.ac"; bool _loadedDefaultOK = true; try { _defaultModel = sgLoad3DModel( globals->get_fg_root(), @@ -133,7 +133,7 @@ void FGAIMgr::init() { f_ident = file.substr(0, pos); FGAirport a; if(dclFindAirportID(f_ident, &a)) { - SGBucket sgb(a._longitude, a._latitude); + SGBucket sgb(a.getLongitude(), a.getLatitude()); int idx = sgb.gen_index(); if(facilities.find(idx) != facilities.end()) { facilities[idx]->push_back(f_ident); @@ -353,13 +353,13 @@ void FGAIMgr::GenerateSimpleAirportTraffic(string ident, double min_dist) { bool cessna = true; // Get the time and only operate VFR in the (approximate) daytime. - //SGTime *t = globals->get_time_params(); - string time_str = fgGetString("sim/time/gmt-string"); - int loc_time = atoi((time_str.substr(0,3)).c_str()); - //cout << "gmt_time = " << loc_time << '\n'; - loc_time += (int)((aptpos.lon() / 360.0) * 24.0); - while(loc_time < 0) loc_time += 24; - while(loc_time > 24) loc_time -= 24; + struct tm *t = globals->get_time_params()->getGmt(); + int loc_time = t->tm_hour + int(aptpos.lon() / (360.0 / 24.0)); + while (loc_time < 0) + loc_time += 24; + while (loc_time >= 24) + loc_time -= 24; + //cout << "loc_time = " << loc_time << '\n'; if(loc_time < 7 || loc_time > 19) return;