Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 20, 2006, 12:31:27 AM (18 years ago)
Author:
marcscha
Message:

Last update, collision working again. SEGFAULT problems

Location:
branches/playability/src/world_entities/projectiles
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/projectiles/lbolt.cc

    r10104 r10117  
    4747  this->setMinEnergy(1);
    4848  this->setHealthMax(0);
    49   this->lifeSpan = 5.0;
     49  this->lifeSpan = 2.0;
    5050
    5151  this->emitter = new DotEmitter(100, 5, M_2_PI);
  • branches/playability/src/world_entities/projectiles/mbolt.cc

    r10113 r10117  
    5353  this->setMinEnergy(4);
    5454  this->setHealthMax(0);
    55   this->lifeSpan = 5.0;
     55  this->lifeSpan = 3.0;
    5656  this->angle     = 0;
    5757
     
    137137  this->lifeCycle = 0.0;
    138138
    139   //this->toList(OM_NULL);
    140139  this->toList(OM_DEAD);
    141   //this->removeNode();
     140  this->removeNode();
    142141  MBolt::fastFactory->kill(this);
    143142}
     
    146145void MBolt::collidesWith(WorldEntity* entity, const Vector& location)
    147146{
    148   PRINTF(0)("MBolt collides pretest\n");
    149 
    150   if( entity == NULL)
     147
     148  if (this->hitEntity != entity)
     149    this->destroy( entity );
     150  this->hitEntity = entity;
     151  dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage());
     152  this->destroy(this);
     153 
     154  return;
     155
     156  if( entity == NULL || dynamic_cast<SpaceShip*>(entity) == NULL)
    151157    return;
    152158
    153   PRINTF(0)("MBolt collides\n");
    154159  dynamic_cast<SpaceShip*>(entity)->damage( this->getPhysDamage(), this->getElecDamage());
    155160  //entity->destroy(this);
     
    179184void MBolt::destroy (WorldEntity* killer)
    180185{
     186  //this->deactivate();
    181187  Projectile::destroy( killer );
    182188  PRINTF(5)("DESTROY MBolt\n");
     
    211217
    212218}
    213 
  • branches/playability/src/world_entities/projectiles/mbolt.h

    r10081 r10117  
    3535    virtual void draw () const;
    3636
    37 
    3837  private:
    3938    static FastFactory*               fastFactory;
  • branches/playability/src/world_entities/projectiles/swarm_projectile.cc

    r10109 r10117  
    136136    this->destroy( entity );
    137137  this->hitEntity = entity;
    138   dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage());
     138  //dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage());
    139139  this->destroy(this);
    140140}
Note: See TracChangeset for help on using the changeset viewer.