Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 7, 2010, 4:14:18 PM (14 years ago)
Author:
gnadler
Message:

orxonox crashes while, respectively after destroying either the Rocket or the Controller.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/rocket/src/modules/weapons/RocketController.cc

    r6834 r6863  
    4848                this->rocket->setController(dynamic_cast<RocketController*>(this));
    4949                this->setControllableEntity(dynamic_cast<ControllableEntity*> (rocket));
     50                this->haha=0;
    5051    }
    5152
     
    5960    void RocketController::tick(float dt)
    6061    {
     62                haha++;
    6163
    6264        SimpleRocket *rocket = static_cast<SimpleRocket*>(this->getControllableEntity());
    63                 double rd = rand();
    64                 if (rd > 0.5) rocket->rotateRoll(5);
     65                rocket->setAcceleration(rocket->getAcceleration()*2);
     66                if (haha < 100) rocket->rotateYaw(10);
     67                else {
     68                if (rand() > 0.5) rocket->rotateRoll(5);
    6569                else rocket->rotatePitch(5);
     70                }
    6671
    6772    }
     
    6974
    7075        RocketController::~RocketController() {
     76               
    7177                COUT(0)<< "RocketController destroyed\n";
    7278        }
Note: See TracChangeset for help on using the changeset viewer.