X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2Fmodelmgr.cxx;h=46ed240f4c8d2f17c7e3d17a4e099bc8d484ad0c;hb=e600cd3d000723b7b7fd4557ad72cfe971daf423;hp=4af505c3802bd25f90d193ae230bdf1ef3349b91;hpb=38193d78431bf35e06667be77259bc84cc4e9e93;p=flightgear.git diff --git a/src/Model/modelmgr.cxx b/src/Model/modelmgr.cxx index 4af505c38..46ed240f4 100644 --- a/src/Model/modelmgr.cxx +++ b/src/Model/modelmgr.cxx @@ -69,13 +69,14 @@ FGModelMgr::add_model (SGPropertyNode * node) SG_LOG(SG_AIRCRAFT, SG_INFO, "Adding model " << node->getStringValue("name", "[unnamed]")); - const char *path = node->getStringValue("path", "Models/Geometry/glider.ac"); + const char *model_path = node->getStringValue("path", "Models/Geometry/glider.ac"); osg::Node *object; try { - object = SGModelLib::loadDeferredModel(path, globals->get_props()); + std::string fullPath = simgear::SGModelLib::findDataFile(model_path); + object = SGModelLib::loadDeferredModel(fullPath, globals->get_props()); } catch (const sg_throwable& t) { - SG_LOG(SG_AIRCRAFT, SG_ALERT, "Error loading " << path << ":\n " + SG_LOG(SG_AIRCRAFT, SG_ALERT, "Error loading " << model_path << ":\n " << t.getFormattedMessage() << t.getOrigin()); return; }