components/prboom/p_lights.c
//
// EV_TurnTagLightsOff()
//
// Turn line's tagged sector's lights to min adjacent neighbor level
//
// Passed the line that activated the lights being turned off
// Returns true
//
// jff 2/12/98 added int return value, fixed return
//
EV_TurnTagLightsOff()
Turn line's tagged sector's lights to min adjacent neighbor level

Passed the line that activated the lights being turned off
Returns true

jff 2/12/98 added int return value, fixed return
EV_TurnTagLightsOff () Turn line ' s tagged sector ' s lights to min adjacent neighbor level Passed the line that activated the lights being turned off Returns true jff 2 / 12 / 98 added int return value fixed return
int EV_TurnTagLightsOff(line_t* line)
{
  int j;
  for (j = -1; (j = P_FindSectorFromLineTag(line,j)) >= 0;)
    {
      sector_t *sector = sectors + j, *tsec;
      int i, min = sector->lightlevel;
      for (i = 0;i < sector->linecount; i++)
  if ((tsec = getNextSector(sector->lines[i], sector)) &&
      tsec->lightlevel < min)
    min = tsec->lightlevel;
      sector->lightlevel = min;
    }
  return 1;
}
int EV_TurnTagLightsOff ( line_t * line ) { int j ; for ( j = -1 ; ( j = P_FindSectorFromLineTag ( line , j ) ) >= 0 ; ) { sector_t * sector = sectors + j , * tsec ; int i , min = sector -> lightlevel ; for ( i = 0 ; i < sector -> linecount ; i ++ ) if ( ( tsec = getNextSector ( sector -> lines [ i ] , sector ) ) && tsec -> lightlevel < min ) min = tsec -> lightlevel ; sector -> lightlevel = min ; } return 1 ; }
EV_TurnTagLightsOff()
Turn line's tagged sector's lights to min adjacent neighbor level
EV_TurnTagLightsOff () Turn line ' s tagged sector ' s lights to min adjacent neighbor level
// search sectors for those with same tag as activating line // killough 10/98: replaced inefficient search with fast search // find min neighbor light level