From: durk Date: Sun, 17 Dec 2006 08:00:14 +0000 (+0000) Subject: Maik Justus: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b34dc24bdc321d47107e1590cf32c884fa4109f5;p=flightgear.git Maik Justus: Here the patch that makes fg search for multiplayer aircraft in AI/Aircraft first. --- diff --git a/src/AIModel/AIBase.cxx b/src/AIModel/AIBase.cxx index da109c1c7..2a1abff84 100644 --- a/src/AIModel/AIBase.cxx +++ b/src/AIModel/AIBase.cxx @@ -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() );