addressing a node with its path is unsafe at that time
FGAIBase::FGAIBase(object_type ot) :
props( NULL ),
+ model_removed( fgGetNode("/ai/models/model-removed", true) ),
manager( NULL ),
fp( NULL ),
_refID( _newAIModelID() ),
if (props) {
SGPropertyNode* parent = props->getParent();
if (parent) {
- fgSetString("/ai/models/model-removed", props->getPath());
+ model_removed->setStringValue(props->getPath());
parent->removeChild(props->getName(), props->getIndex(), false);
}
}
protected:
SGPropertyNode_ptr props;
+ SGPropertyNode_ptr model_removed; // where to report model removal
FGAIManager* manager;
// these describe the model's actual state