1
0
Fork 0

Default to glider again when model is not present.

This commit is contained in:
david 2002-05-29 22:04:36 +00:00
parent 7e63c0f6e8
commit 1a4b6a37a3

View file

@ -52,7 +52,14 @@ void
FGAircraftModel::init () FGAircraftModel::init ()
{ {
_aircraft = new FG3DModel; _aircraft = new FG3DModel;
_aircraft->init(fgGetString("/sim/model/path", "Models/Geometry/glider.ac")); string path = fgGetString("/sim/model/path", "Models/Geometry/glider.ac");
try {
_aircraft->init(path);
} catch (const sg_exception &ex) {
SG_LOG(SG_GENERAL, SG_ALERT, "Failed to load aircraft from " << path);
SG_LOG(SG_GENERAL, SG_ALERT, "(Falling back to glider.ac.)");
_aircraft->init("Models/Geometry/glider.ac");
}
_scene->addKid(_aircraft->getSceneGraph()); _scene->addKid(_aircraft->getSceneGraph());
_selector->addKid(_aircraft->getSceneGraph()); _selector->addKid(_aircraft->getSceneGraph());
globals->get_scenery()->get_aircraft_branch()->addKid(_selector); globals->get_scenery()->get_aircraft_branch()->addKid(_selector);