Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 4, 2006, 2:24:40 PM (17 years ago)
Author:
patrick
Message:

removed many very heavy segfaults

File:
1 edited

Legend:

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

    r9990 r10006  
    142142  bool CollisionFilter::operator()(const WorldEntity& entity) const
    143143  {
    144     // if there are no installed criterions just ommit and
    145     if( this->isReactive())
     144    PRINTF(0)("operator()(const WorldEntity& entity)\n");
     145
     146    // if there are no installed criterions just ommit and return
     147    if( !this->isReactive())
    146148      return false;
    147149
     
    149151    for( int i = 0; i < CREngine::CR_NUMBER; i++ )
    150152    {
    151       std::vector<ClassID>::const_iterator it = this->_filters[i].begin();
    152       for(; it != this->_filters[i].end(); i++ )
     153      TargetIteratorConst it = this->_filters[i].begin();
     154      for(; it != this->_filters[i].end(); it++ )
     155      {
     156         PRINTF(0)("[%i] check %s is a %s?\n", i, entity.getClassName().c_str(), (*it).name().c_str());
    153157        if( unlikely(entity.isA(*it) ) )
    154158          return true;
     159      }
    155160    }
    156161
     
    168173  bool CollisionFilter::operator()(const WorldEntity& entity, const CREngine::ReactionType type) const
    169174  {
     175    assert(&entity != NULL);
     176
     177    PRINTF(0)("operator()(const WorldEntity& entity, const CREngine::ReactionType type)\n");
    170178    // if there are no installed criterions just omit and return
    171179    if( !this->isReactive())
    172180      return false;
    173181
     182
    174183    // goes through all registered filter criterions and looks for matches
    175184    TargetIteratorConst it = this->_filters[type].begin();
    176185    for(; it != this->_filters[type].end(); it++ )
    177       if( unlikely(entity.isA(*it)))
     186    {
     187       PRINTF(0)("size: %i - %s is a %s?\n", this->_filters[type].size(), entity.getClassName().c_str(), (*it).name().c_str());
     188      if( entity.isA(*it))
    178189        return true;
     190    }
    179191
    180192    return false;
Note: See TracChangeset for help on using the changeset viewer.