]> git.mxchange.org Git - flightgear.git/commitdiff
Maik Justus:
authordurk <durk>
Sun, 17 Dec 2006 08:00:14 +0000 (08:00 +0000)
committerdurk <durk>
Sun, 17 Dec 2006 08:00:14 +0000 (08:00 +0000)
Here the patch that makes fg search for multiplayer aircraft in AI/Aircraft
first.

src/AIModel/AIBase.cxx

index da109c1c7ae8fd25753ec87f26f54168ea5c6ca2..2a1abff840e822604cc7c89094a78626f530e7e3 100644 (file)
@@ -128,12 +128,22 @@ void FGAIBase::Transform() {
 bool FGAIBase::init() {
 
    if (!model_path.empty()) {
+     SGPath ai_path("AI");
+     ai_path.append(model_path);
      try {
-       model = load3DModel( globals->get_fg_root(), model_path, props,
-                            globals->get_sim_time_sec() );
+       model = load3DModel( globals->get_fg_root(), ai_path.str(), props,
+                        globals->get_sim_time_sec() );
      } catch (const sg_exception &e) {
        model = NULL;
      }
+     if (!model) {
+       try {
+         model = load3DModel( globals->get_fg_root(), model_path, props,
+                        globals->get_sim_time_sec() );
+       } catch (const sg_exception &e) {
+         model = NULL;
+       }
+     }
    }
    if (model.get()) {
      aip.init( model.get() );