components/prboom/p_spec.c
//
// P_FindMinSurroundingLight()
//
// Passed a sector and a light level, returns the smallest light level
// in a surrounding sector less than that passed. If no smaller light
// level exists, the light level passed is returned.
//
P_FindMinSurroundingLight()
Passed a sector and a light level, returns the smallest light level
in a surrounding sector less than that passed. If no smaller light
level exists, the light level passed is returned.
P_FindMinSurroundingLight () Passed a sector and a light level returns the smallest light level in a surrounding sector less than that passed . If no smaller light level exists the light level passed is returned .
int P_FindMinSurroundingLight
( sector_t*     sector,
  int           max )
{
  int         i;
  int         min;
  line_t*     line;
  sector_t*   check;
  min = max;
  for (i=0 ; i < sector->linecount ; i++)
  {
    line = sector->lines[i];
    check = getNextSector(line,sector);
    if (!check)
      continue;
    if (check->lightlevel < min)
      min = check->lightlevel;
  }
  return min;
}
int P_FindMinSurroundingLight ( sector_t * sector , int max ) { int i ; int min ; line_t * line ; sector_t * check ; min = max ; for ( i = 0 ; i < sector -> linecount ; i ++ ) { line = sector -> lines [ i ] ; check = getNextSector ( line , sector ) ; if ( ! check ) continue ; if ( check -> lightlevel < min ) min = check -> lightlevel ; } return min ; }
P_FindMinSurroundingLight()
Passed a sector and a light level, returns the smallest light level
in a surrounding sector less than that passed.
P_FindMinSurroundingLight () Passed a sector and a light level returns the smallest light level in a surrounding sector less than that passed .