Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 3, 2006, 6:24:08 PM (18 years ago)
Author:
patrick
Message:

found another two segfaults and removed them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/coll_rect/src/lib/collision_reaction/collision_tube.cc

    r9985 r9994  
    3434  ObjectListDefinition(CollisionTube);
    3535
    36   CollisionTube* CollisionTube::instance = NULL;
     36  CollisionTube* CollisionTube::singletonRef = NULL;
    3737
    3838
     
    6767  void CollisionTube::registerCollisionEvent(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB)
    6868  {
    69     Collision* collision = this->_collisionList.back();
     69    Collision* collision = NULL;
     70    if( !this->_collisionList.empty())
     71      collision = this->_collisionList.back();
    7072
    71     // check if there is already a collision defined between these objects
    72     if( !collision->match(*entityA, *entityB))
     73    // check if there is already a collision defined between these objects or this is the first collision at all
     74    if( collision != NULL || !collision->match(*entityA, *entityB))
    7375    {
    7476      collision = CREngine::getInstance()->popCollisionObject();
     
    9698  {
    9799    // get last collision
    98     Collision* collision = this->_collisionList.back();
     100    Collision* collision = NULL;
     101    if( !this->_collisionList.empty())
     102      collision = this->_collisionList.back();
    99103
    100104    // check if there is already a collision defined between these objects
Note: See TracChangeset for help on using the changeset viewer.