- string planepath = "Aircraft/c172/Models/c172-dpm.ac";
- _defaultModel = sgLoad3DModel( globals->get_fg_root(),
- planepath.c_str(),
- globals->get_props(),
- globals->get_sim_time_sec() );
+ string planepath = "Aircraft/c172r/Models/c172-dpm.ac";
+ bool _loadedDefaultOK = true;
+ try {
+ _defaultModel = sgLoad3DModel( globals->get_fg_root(),
+ planepath.c_str(),
+ globals->get_props(),
+ globals->get_sim_time_sec() );
+ } catch(sg_exception& e) {
+ _loadedDefaultOK = false;
+ }
+
+ if(!_loadedDefaultOK ) {
+ // Just load the same 3D model as the default user plane - that's *bound* to exist!
+ // TODO - implement robust determination of availability of GA AI aircraft models
+ planepath = "Aircraft/c172p/Models/c172p.ac";
+ _defaultModel = sgLoad3DModel( globals->get_fg_root(),
+ planepath.c_str(),
+ globals->get_props(),
+ globals->get_sim_time_sec() );
+ }