Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 10, 2015, 6:38:44 PM (9 years ago)
Author:
landauf
Message:

the AI sometimes selected its own ship as target while it was steering a rocket. after destroying the rocket, the AI would then try to hit itself which led to random crashes (because of a division by zero error which was previously fixed in r10630).
this commit does not fix the root cause, but detects this case and changes the target.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/controllers/FormationController.cc

    r10624 r10631  
    10871087    }
    10881088
     1089    void FormationController::changedControllableEntity()
     1090    {
     1091        Controller::changedControllableEntity(); // super
     1092
     1093        // when changing the controllable entity, ensure that the controller does not use the new entity as target
     1094        if (this->target_ && this->getControllableEntity() == static_cast<ControllableEntity*>(this->target_))
     1095            this->forgetTarget();
     1096    }
    10891097}
Note: See TracChangeset for help on using the changeset viewer.