From 905f5a1029b98dd1242b4d3577e0cb11efd733bc Mon Sep 17 00:00:00 2001 From: fredb Date: Fri, 25 Aug 2006 22:16:31 +0000 Subject: [PATCH] Better encapsulation for personality --- src/AIModel/AIBase.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/AIModel/AIBase.cxx b/src/AIModel/AIBase.cxx index ac9d0861a..1fe6a7e0e 100644 --- a/src/AIModel/AIBase.cxx +++ b/src/AIModel/AIBase.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -162,6 +163,8 @@ ssgBranch * FGAIBase::load3DModel(const string& fg_root, // some more code here to check whether a model with this name has already been loaded // if not load it, otherwise, get the memory pointer and do something like // SetModel as in ATC/AIEntity.cxx + ssgBranch *personality_branch = new SGPersonalityBranch; + model = manager->getModel(path); if (!(model)) { model = sgLoad3DModel(fg_root, @@ -170,8 +173,9 @@ ssgBranch * FGAIBase::load3DModel(const string& fg_root, sim_time_sec); manager->setModel(path, model); } + personality_branch->addKid( model ); - return model; + return personality_branch; } bool FGAIBase::isa( object_type otype ) { -- 2.39.5