Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 24, 2007, 6:13:17 PM (17 years ago)
Author:
marcscha
Message:

SegFault prevention hack in fast factory

File:
1 edited

Legend:

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

    r10333 r10345  
    5656
    5757
    58   int rnd = rand()/3;
     58  int rnd = int(rand() % 3);
    5959
    6060  switch (rnd){
     
    7676//     this->grid->setTexture( "maps/blub.png");
    7777
    78   this->grid->toList(OM_ENVIRON); //this->getOMListNumber());
    79   this->toList(OM_ENVIRON);
     78  this->grid->toList(OM_ENVIRON);
    8079}
    8180
     
    8988  // delete this->emitter;
    9089  //delete this->grid;
    91  
    9290  this->grid->toList(OM_DEAD);
    9391 
     
    9795void AcidSplash::activate()
    9896{
    99   this->unhide();
     97  this->origList = this->getOMListNumber();
     98  this->toList(OM_ENVIRON);
     99 // this->unhide();
    100100  this->grid->setVisibiliy(true);
    101101
     
    110110  this->lifeCycle = 0.0;
    111111
    112   this->hide();
     112 // this->hide();
    113113  this->grid->setVisibiliy(false);
    114   this->toList(OM_DEAD);
     114  this->lifeCycle = 0.0;
     115  this->toList(OM_NULL);
     116  //this->toList(OM_DEAD);
    115117  this->removeNode();
    116118 
     
    155157  for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
    156158  {
    157     if( ((*eIterator)->getOMListNumber() == (this->getOMListNumber() -1))  && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)
     159    if( ((*eIterator)->getOMListNumber() != (this->origList -1))  && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)
    158160    {
    159161      (*eIterator)->hit (this->getDamage(),this);
Note: See TracChangeset for help on using the changeset viewer.