]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/AIEntity.cxx
don't set the callsign, but use the set one
[flightgear.git] / src / ATC / AIEntity.cxx
index 79d10a6a2a823f0d6b5f4cfd9829a991bb690eac..c8aeab1e3cef815d5d2fb23260e0f3775725a712 100644 (file)
@@ -45,7 +45,6 @@ FGAIEntity::FGAIEntity() {
 
 FGAIEntity::~FGAIEntity() {
        //cout << "FGAIEntity dtor called..." << endl;
-       _model->deRef();        // 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) {
@@ -80,5 +79,5 @@ void FGAIEntity::RegisterTransmission(int code) {
 void FGAIEntity::Transform() {
     _aip.setPosition(_pos.lon(), _pos.lat(), _pos.elev() * SG_METER_TO_FEET);
     _aip.setOrientation(_roll, _pitch, _hdg);
-    _aip.update( globals->get_scenery()->get_center() );    
+    _aip.update();    
 }