Expose aircraft-dirs under /sim (read-only, for security)
This commit is contained in:
parent
e43456ba43
commit
dbd9935c52
1 changed files with 9 additions and 0 deletions
|
@ -105,6 +105,7 @@ FGGlobals::FGGlobals() :
|
||||||
airwaynet( NULL ),
|
airwaynet( NULL ),
|
||||||
multiplayer_mgr( NULL )
|
multiplayer_mgr( NULL )
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -239,7 +240,15 @@ void FGGlobals::append_aircraft_path(const std::string& path)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int index = fg_aircraft_dirs.size();
|
||||||
fg_aircraft_dirs.push_back(path);
|
fg_aircraft_dirs.push_back(path);
|
||||||
|
|
||||||
|
// make aircraft dirs available to Nasal
|
||||||
|
SGPropertyNode* sim = fgGetNode("/sim", true);
|
||||||
|
sim->removeChild("fg-aircraft", index, false);
|
||||||
|
SGPropertyNode* n = sim->getChild("fg-aircraft", index, true);
|
||||||
|
n->setStringValue(path);
|
||||||
|
n->setAttribute(SGPropertyNode::WRITE, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FGGlobals::append_aircraft_paths(const std::string& path)
|
void FGGlobals::append_aircraft_paths(const std::string& path)
|
||||||
|
|
Loading…
Reference in a new issue