Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 8, 2007, 9:46:13 PM (18 years ago)
Author:
nicolasc
Message:

just another upload
GUI seems to work, but there are still some unexplainable segfaults

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/weapons/spike_thrower.cc

    r10180 r10196  
    146146void SpikeThrower::fire()
    147147{
    148   bool fired  = false;
     148  Projectile* pj =  this->getProjectile();
     149  if (pj == NULL)
     150    return;
    149151
    150   Projectile* pj = NULL;
    151   for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
    152   {
    153     if( ((*eIterator)->getOMListNumber() == OM_GROUP_00) && ((*eIterator)->getClassCName() != "Weapon") && ((*eIterator)->getClassCName() != "Projectile") && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 300)
    154     {
    155       pj  = this->getProjectile();
    156       if (pj == NULL)
    157         return;
    158      
    159       fired = true;
    160       pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*115.0 + VECTOR_RAND(10)));
     152  // set the owner
     153  pj->setOwner(this->getOwner());
    161154
    162       pj->setParent(PNode::getNullParent());
    163       pj->setAbsCoor(this->getEmissionPoint());
    164       pj->setAbsDir(this->getAbsDir());
    165 //       dynamic_cast<SpikeProjectile*>(pj)->setTarget( (PNode*)(*eIterator) );
    166       pj->toList(OM_GROUP_01_PROJ);
    167       pj->activate();
    168     }
    169   }
    170   if( !fired)
    171     this->increaseEnergy( this->getProjectile()->getMinEnergy());
     155  pj->setParent(PNode::getNullParent());
     156
     157  pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*150);
     158  pj->setAbsCoor(this->getEmissionPoint());
     159
     160  pj->setAbsDir(this->getAbsDir());
     161  pj->activate();
    172162}
Note: See TracChangeset for help on using the changeset viewer.