p_move.c
//
// Check a single mobj in one of the contacted blockmap cells.
//
Check a single mobj in one of the contacted blockmap cells.
Check a single mobj in one of the contacted blockmap cells .
boolean PIT_CheckThing(mobj_t *thing)
{
   fixed_t blockdist;
   int     delta;
   if(!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_SHOOTABLE)))
      return true;
   blockdist = thing->radius + tmthing->radius;
   delta = thing->x - tmx;
   if(delta < 0)
      delta = -delta;
   if(delta >= blockdist)
      return true; 
   delta = thing->y - tmy;
   if(delta < 0)
      delta = -delta;
   if(delta >= blockdist)
      return true; 
   if(thing == tmthing)
      return true; 
   if(tmthing->flags & MF_SKULLFLY)
   {
      movething = thing;
      return false; 
   }
   if(tmthing->flags & MF_MISSILE)
   {
      if(tmthing->z > thing->z + thing->height)
         return true; 
      if(tmthing->z + tmthing->height < thing->z)
         return true; 
      if(tmthing->target->type == thing->type) 
      {
         if(thing == tmthing->target) 
            return true;
         if(thing->type != MT_PLAYER) 
            return false; 
      }
      if(!(thing->flags & MF_SHOOTABLE))
         return !(thing->flags & MF_SOLID); 
      movething = thing;
      return false; 
   }
   if((thing->flags & MF_SPECIAL) && (tmflags & MF_PICKUP))
   {
      movething = thing;
      return true;
   }
   return !(thing->flags & MF_SOLID);
}
boolean PIT_CheckThing ( mobj_t * thing ) { fixed_t blockdist ; int delta ; if ( ! ( thing -> flags & ( MF_SOLID | MF_SPECIAL | MF_SHOOTABLE ) ) ) return true ; blockdist = thing -> radius + tmthing -> radius ; delta = thing -> x - tmx ; if ( delta < 0 ) delta = - delta ; if ( delta >= blockdist ) return true ; delta = thing -> y - tmy ; if ( delta < 0 ) delta = - delta ; if ( delta >= blockdist ) return true ; if ( thing == tmthing ) return true ; if ( tmthing -> flags & MF_SKULLFLY ) { movething = thing ; return false ; } if ( tmthing -> flags & MF_MISSILE ) { if ( tmthing -> z > thing -> z + thing -> height ) return true ; if ( tmthing -> z + tmthing -> height < thing -> z ) return true ; if ( tmthing -> target -> type == thing -> type ) { if ( thing == tmthing -> target ) return true ; if ( thing -> type != MT_PLAYER ) return false ; } if ( ! ( thing -> flags & MF_SHOOTABLE ) ) return ! ( thing -> flags & MF_SOLID ) ; movething = thing ; return false ; } if ( ( thing -> flags & MF_SPECIAL ) && ( tmflags & MF_PICKUP ) ) { movething = thing ; return true ; } return ! ( thing -> flags & MF_SOLID ) ; }
Check a single mobj in one of the contacted blockmap cells.
Check a single mobj in one of the contacted blockmap cells .
// didn't hit it // didn't hit it // don't clip against self // check for skulls slamming into things // stop moving // missiles can hit other things // went overhead // went underneath // don't hit same species as originator // don't hit originator // let players missile each other // explode, but do no damage // didn't do any damage // damage/explode // don't traverse any more // check for special pickup