before the property tree is stored away for reinit, so the signal would
be emitted again on reset.
- fix inconsistent style that sneaked in with a previous patch
FGNasalSys::~FGNasalSys()
{
map<int, FGNasalListener *>::iterator it, end = _listener.end();
FGNasalSys::~FGNasalSys()
{
map<int, FGNasalListener *>::iterator it, end = _listener.end();
- for (it = _listener.begin(); it != end; ++it)
+ for(it = _listener.begin(); it != end; ++it)
delete it->second;
// Nasal doesn't have a "destroy context" API yet. :(
delete it->second;
// Nasal doesn't have a "destroy context" API yet. :(
loadModule(fullpath, file.base().c_str());
}
ulCloseDir(dir);
loadModule(fullpath, file.base().c_str());
}
ulCloseDir(dir);
- fgSetBool("/sim/signals/nasal-dir-initialized", true);
+
+ // set signal and remove node to avoid restoring at reinit
+ const char *s = "nasal-dir-initialized";
+ SGPropertyNode *signal = fgGetNode("/sim/signals", true);
+ signal->setBoolValue(s, true);
+ signal->removeChildren(s);
// Pull scripts out of the property tree, too
loadPropertyScripts();
// Pull scripts out of the property tree, too
loadPropertyScripts();
else if(naIsGhost(prop)) node = *(SGPropertyNode_ptr*)naGhost_ptr(prop);
else return naNil();
else if(naIsGhost(prop)) node = *(SGPropertyNode_ptr*)naGhost_ptr(prop);
else return naNil();
SG_LOG(SG_NASAL, SG_DEBUG, "Attaching listener to tied property " <<
node->getPath());
SG_LOG(SG_NASAL, SG_DEBUG, "Attaching listener to tied property " <<
node->getPath());
osg::Node *)
{
SGPropertyNode *n = prop->getNode("nasal"), *load;
osg::Node *)
{
SGPropertyNode *n = prop->getNode("nasal"), *load;
return;
load = n->getNode("load");
_unload = n->getNode("unload");
return;
load = n->getNode("load");
_unload = n->getNode("unload");
FGNasalModelData::~FGNasalModelData()
{
FGNasalModelData::~FGNasalModelData()
{
return;
FGNasalSys *nas = (FGNasalSys *)globals->get_subsystem("nasal");
return;
FGNasalSys *nas = (FGNasalSys *)globals->get_subsystem("nasal");
SG_LOG(SG_NASAL, SG_ALERT, "Trying to run an <unload> script "
"without Nasal subsystem present.");
return;
}
SG_LOG(SG_NASAL, SG_ALERT, "Trying to run an <unload> script "
"without Nasal subsystem present.");
return;
}
const char *s = _unload->getStringValue();
nas->createModule(_module.c_str(), _module.c_str(), s, strlen(s));
}
const char *s = _unload->getStringValue();
nas->createModule(_module.c_str(), _module.c_str(), s, strlen(s));
}