]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/AIEntity.cxx
This innocuous looking typo was crashing the sim whenever an AI plane was asked to...
[flightgear.git] / src / ATC / AIEntity.cxx
index 945668a15b227e3eb67928d19d541560a05ab67b..f4d58cd1d657f73ff79b024c2827b8599d6b62a3 100644 (file)
@@ -16,7 +16,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 /*****************************************************************
 *
@@ -45,7 +45,6 @@ FGAIEntity::FGAIEntity() {
 
 FGAIEntity::~FGAIEntity() {
        //cout << "FGAIEntity dtor called..." << endl;
-        ssgDeRefDelete(_model);        // Ought to check valid?
        //cout << "Removing model from scene graph..." << endl;
        globals->get_scenery()->get_scene_graph()->removeKid(_aip.getSceneGraph());
         // Unregister that one at the scenery manager
@@ -56,7 +55,6 @@ FGAIEntity::~FGAIEntity() {
 
 void FGAIEntity::SetModel(ssgBranch* model) {
        _model = model;
-       _model->ref();
        _aip.init(_model);
        _aip.setVisible(false);
        globals->get_scenery()->get_scene_graph()->addKid(_aip.getSceneGraph());
@@ -68,8 +66,9 @@ void FGAIEntity::SetModel(ssgBranch* model) {
 void FGAIEntity::Update(double dt) {
 }
 
-string FGAIEntity::GetCallsign() {
-       return("");
+const string &FGAIEntity::GetCallsign() {
+       static string s = "";
+       return(s);
 }
 
 void FGAIEntity::RegisterTransmission(int code) {