diff --git a/src/AIModel/AIBallistic.cxx b/src/AIModel/AIBallistic.cxx index d31e3b46d..b3e3bceb5 100644 --- a/src/AIModel/AIBallistic.cxx +++ b/src/AIModel/AIBallistic.cxx @@ -143,6 +143,8 @@ bool FGAIBallistic::init(bool search_in_AI_path) { _elapsed_time += (sg_random() * 100); + _life_timer = 0; + props->setStringValue("material/name", ""); props->setStringValue("name", _name.c_str()); props->setStringValue("submodels/path", _path.c_str()); @@ -152,6 +154,9 @@ bool FGAIBallistic::init(bool search_in_AI_path) { props->setStringValue("contents/path", _contents_path.c_str()); } + //cout << "init: name " << _name.c_str() << " _life_timer " << _life_timer + // << endl; + //if(_parent != ""){ // setParentNode(); //} @@ -330,7 +335,7 @@ void FGAIBallistic::setLife(double seconds) { if (_random){ life = seconds * _randomness + (seconds * (1 -_randomness) * sg_random()); - //cout << "life " << life << endl; + //cout << " set life " << life << endl; } else life = seconds; } @@ -670,15 +675,23 @@ void FGAIBallistic::slaveToAC(double dt){ void FGAIBallistic::Run(double dt) { _life_timer += dt; + + //_pass += 1; + //cout<<"AIBallistic run: name " << _name.c_str() + // << " dt " << dt << " _life_timer " << _life_timer << " pass " << _pass << endl; // if life = -1 the object does not die if (_life_timer > life && life != -1){ if (_report_expiry && !_expiry_reported && !_impact_reported && !_collision_reported){ - //cout<<"AIBallistic: expiry"<< endl; + //cout<<"AIBallistic run: name " << _name.c_str() << " expiry " << " pass " << _pass <setStringValue("type", "terrain"); SG_LOG(SG_GENERAL, SG_DEBUG, "AIBallistic: object impact " << _name - << " lon " <<_impact_lon << " lat " <<_impact_lat); + << " lon " <<_impact_lon << " lat " <<_impact_lat << " sec " << _life_timer); n->setDoubleValue("longitude-deg", _impact_lon); n->setDoubleValue("latitude-deg", _impact_lat);