Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10326 in orxonox.OLD


Ignore:
Timestamp:
Jan 24, 2007, 11:32:13 AM (17 years ago)
Author:
patrick
Message:

fixed a segfault in the fps player

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/creatures/fps_player.cc

    r10321 r10326  
    166166  this->initWeapon = false;
    167167  this->damageTicker = 0.0f;
     168
    168169}
    169170
     
    241242
    242243
    243     if( this->aimingSystem != NULL)
    244     {
    245       this->aimingSystem->toList(OM_GROUP_01);
    246       this->aimingSystem->setParent(&this->cameraNode);
    247   //     this->aimingSystem->setParentMode(PNODE_ROTATE_AND_MOVE);
    248       this->aimingSystem->setRelDir(Quaternion(M_PI_4*-0.58f, Vector(0,0,1)));
    249       this->aimingSystem->setRelCoor(0, -1, -1);
    250     }
     244//     if( this->aimingSystem != NULL)
     245//     {
     246//       this->aimingSystem->toList(OM_GROUP_01);
     247//       this->aimingSystem->setParent(&this->cameraNode);
     248//   //     this->aimingSystem->setParentMode(PNODE_ROTATE_AND_MOVE);
     249//       this->aimingSystem->setRelDir(Quaternion(M_PI_4*-0.58f, Vector(0,0,1)));
     250//       this->aimingSystem->setRelCoor(0, -1, -1);
     251//     }
    251252
    252253
     
    341342  velocity *= 100;
    342343
    343   if( this->bJump && likely(this->getModel(0) != NULL))
    344   {
    345     if( this->jumpForce < 1.0f)
     344  if( this->getModel( 0) != NULL)
     345  {
     346    if( this->bJump)
    346347    {
    347       this->jumpForce = 300.0f;
    348 
    349       if( ((InteractiveModel*)this->getModel(0))->getAnimation() != JUMP)
    350         ((InteractiveModel*)this->getModel(0))->setAnimation(JUMP);
     348      if( this->jumpForce < 1.0f)
     349      {
     350        this->jumpForce = 300.0f;
     351
     352        if( ((InteractiveModel*)this->getModel(0))->getAnimation() != JUMP)
     353          ((InteractiveModel*)this->getModel(0))->setAnimation(JUMP);
     354      }
    351355    }
    352   }
    353   else if(velocity.len() != 0.0f)
    354   {
    355     if( ((InteractiveModel*)this->getModel(0))->getAnimation() != RUN)
    356       ((InteractiveModel*)this->getModel(0))->setAnimation(RUN);
    357   }
    358   else
    359   {
    360     if( ((InteractiveModel*)this->getModel(0))->getAnimation() != STAND)
    361       ((InteractiveModel*)this->getModel(0))->setAnimation(STAND);
     356    else if(velocity.len() != 0.0f)
     357    {
     358      if( ((InteractiveModel*)this->getModel(0))->getAnimation() != RUN)
     359        ((InteractiveModel*)this->getModel(0))->setAnimation(RUN);
     360    }
     361    else
     362    {
     363      if( ((InteractiveModel*)this->getModel(0))->getAnimation() != STAND)
     364        ((InteractiveModel*)this->getModel(0))->setAnimation(STAND);
     365    }
    362366  }
    363367
     
    395399
    396400  this->setOnGround(false);
    397   this->aimingSystem->flushList();
     401  if( this->aimingSystem != NULL)
     402    this->aimingSystem->flushList();
    398403}
    399404
Note: See TracChangeset for help on using the changeset viewer.