1
0
Fork 0

Bugfix: Ballistic objects with "expiry" set were not instantiating correctly.

Signed-off-by: Vivian Meazza <vivian.meazza@lineone.net>
This commit is contained in:
Vivian Meazza 2011-08-09 18:20:18 +01:00 committed by Anders Gidenstam
parent 5093cbed43
commit ce97a1e4c5

View file

@ -684,15 +684,16 @@ void FGAIBallistic::Run(double dt) {
if (_life_timer > life && life != -1){ if (_life_timer > life && life != -1){
if (_report_expiry && !_expiry_reported && !_impact_reported && !_collision_reported){ if (_report_expiry && !_expiry_reported && !_impact_reported && !_collision_reported){
//cout<<"AIBallistic run: name " << _name.c_str() << " expiry " << " pass " << _pass <<endl; //cout<<"AIBallistic run: name " << _name.c_str() << " expiry "
//<< " _life_timer " << _life_timer<< endl;
handle_expiry(); handle_expiry();
} else{ } else{
//cout<<"AIBallistic run: name " << _name.c_str() //cout<<"AIBallistic run: name " << _name.c_str()
// << " die " << " _life_timer " << _life_timer << " pass " << _pass << endl; // << " die " << " _life_timer " << _life_timer << endl;
setDie(true); setDie(true);
setTime(0);
} }
setTime(0);
} }
//set the contents in the appropriate tank or other property in the parent to zero //set the contents in the appropriate tank or other property in the parent to zero
@ -982,7 +983,7 @@ void FGAIBallistic::handle_impact() {
void FGAIBallistic::handle_expiry() { void FGAIBallistic::handle_expiry() {
SG_LOG(SG_GENERAL, SG_DEBUG, "AIBallistic: handle_expiry " << pos.getElevationM()); //SG_LOG(SG_GENERAL, SG_DEBUG, "AIBallistic: handle_expiry " << pos.getElevationM());
report_impact(pos.getElevationM()); report_impact(pos.getElevationM());
_expiry_reported = true; _expiry_reported = true;