1
0
Fork 0

make sure the node for the AI model removal report exists;

addressing a node with its path is unsafe at that time
This commit is contained in:
mfranz 2006-11-26 12:02:06 +00:00
parent 68db72bf4d
commit c0e1a380d6
2 changed files with 3 additions and 1 deletions

View file

@ -52,6 +52,7 @@ const double FGAIBase::lbs_to_slugs = 0.031080950172; //conversion factor
FGAIBase::FGAIBase(object_type ot) :
props( NULL ),
model_removed( fgGetNode("/ai/models/model-removed", true) ),
manager( NULL ),
fp( NULL ),
_refID( _newAIModelID() ),
@ -77,7 +78,7 @@ FGAIBase::~FGAIBase() {
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);
}
}

View file

@ -80,6 +80,7 @@ public:
protected:
SGPropertyNode_ptr props;
SGPropertyNode_ptr model_removed; // where to report model removal
FGAIManager* manager;
// these describe the model's actual state