components/prboom/p_map.c
//
// P_CheckSector
// jff 3/19/98 added to just check monsters on the periphery
// of a moving sector instead of all in bounding box of the
// sector. Both more accurate and faster.
//
P_CheckSector
jff 3/19/98 added to just check monsters on the periphery
of a moving sector instead of all in bounding box of the
sector. Both more accurate and faster.
P_CheckSector jff 3 / 19 / 98 added to just check monsters on the periphery of a moving sector instead of all in bounding box of the sector . Both more accurate and faster .
boolean P_CheckSector(sector_t* sector,boolean crunch)
  {
  msecnode_t *n;
  if (comp[comp_floors]) 
    return P_ChangeSector(sector,crunch);
  nofit = false;
  crushchange = crunch;
   killough 4/7/98: simplified to avoid using complicated counter
   Mark all things invalid
  for (n=sector->touching_thinglist; n; n=n->m_snext)
    n->visited = false;
  do
    for (n=sector->touching_thinglist; n; n=n->m_snext)   go through list
      if (!n->visited)                unprocessed thing found
        {
        n->visited  = true;           mark thing as processed
        if (!(n->m_thing->flags & MF_NOBLOCKMAP)) jff 4/7/98 don't do these
          PIT_ChangeSector(n->m_thing);     process it
        break;                  exit and start over
        }
  while (n);   repeat from scratch until all things left are marked valid
  return nofit;
  }
boolean P_CheckSector ( sector_t * sector , boolean crunch ) { msecnode_t * n ; if ( comp [ comp_floors ] ) return P_ChangeSector ( sector , crunch ) ; nofit = false ; crushchange = crunch ; for ( n = sector -> touching_thinglist ; n ; n = n -> m_snext ) n -> visited = false ; do for ( n = sector -> touching_thinglist ; n ; n = n -> m_snext ) if ( ! n -> visited ) { n -> visited = true ; if ( ! ( n -> m_thing -> flags & MF_NOBLOCKMAP ) ) PIT_ChangeSector ( n -> m_thing ) ; break ; } while ( n ) ; return nofit ; }
P_CheckSector
jff 3/19/98 added to just check monsters on the periphery
of a moving sector instead of all in bounding box of the
sector.
P_CheckSector jff 3 / 19 / 98 added to just check monsters on the periphery of a moving sector instead of all in bounding box of the sector .
/* use the old routine for old demos though */ // killough 4/4/98: scan list front-to-back until empty or exhausted, // restarting from beginning after each thing is processed. Avoids // crashes, and is sure to examine all things in the sector, and only // the things which are in the sector, until a steady-state is reached. // Things can arbitrarily be inserted and removed and it won't mess up. // // killough 4/7/98: simplified to avoid using complicated counter // Mark all things invalid // go through list // unprocessed thing found // mark thing as processed //jff 4/7/98 don't do these // process it // exit and start over // repeat from scratch until all things left are marked valid