components/prboom/p_lights.c
//
// T_LightFlash()
//
// Broken light flashing action routine, called once per tick
//
// Passed a lightflash_t structure containing light levels and timing
// Returns nothing
//
T_LightFlash()
Broken light flashing action routine, called once per tick

Passed a lightflash_t structure containing light levels and timing
Returns nothing
T_LightFlash () Broken light flashing action routine called once per tick Passed a lightflash_t structure containing light levels and timing Returns nothing
void T_LightFlash (lightflash_t* flash)
{
  if (--flash->count)
    return;
  if (flash->sector->lightlevel == flash->maxlight)
  {
    flash-> sector->lightlevel = flash->minlight;
    flash->count = (P_Random(pr_lights)&flash->mintime)+1;
  }
  else
  {
    flash-> sector->lightlevel = flash->maxlight;
    flash->count = (P_Random(pr_lights)&flash->maxtime)+1;
  }
}
void T_LightFlash ( lightflash_t * flash ) { if ( -- flash -> count ) return ; if ( flash -> sector -> lightlevel == flash -> maxlight ) { flash -> sector -> lightlevel = flash -> minlight ; flash -> count = ( P_Random ( pr_lights ) & flash -> mintime ) + 1 ; } else { flash -> sector -> lightlevel = flash -> maxlight ; flash -> count = ( P_Random ( pr_lights ) & flash -> maxtime ) + 1 ; } }
T_LightFlash()
Broken light flashing action routine, called once per tick
T_LightFlash () Broken light flashing action routine called once per tick