Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 13, 2005, 2:55:08 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: PNode compiles again
PNode is now handled with the erase function of stl, rather than remove (which is totally the wrong way when iterating through a list and delete elements)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/weapons/projectile.cc

    r6074 r6078  
    3737  this->lifeCycle = 0.0;
    3838  this->lifeSpan = 1.0f; /* sec */
    39   this->target.addNodeModeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT |
    40                                 PNODE_REPARENT_TO_NULLPARENT);
    41 
     39  this->target = NULL;
    4240  this->removeNode();
    4341}
     
    103101void Projectile::setTarget(PNode* target)
    104102{
    105   this->target.setParent(target);
     103  if (this->target == NULL)
     104    this->target = new PNode(target, PNODE_PARENT_MODE_DEFAULT | PNODE_REPARENT_ON_PARENTS_REMOVE);
     105  else
     106    this->target->setParent(target);
    106107}
    107108
Note: See TracChangeset for help on using the changeset viewer.