Skip to content

Commit

Permalink
Fire alarms no longer burn out lights (#4636)
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy authored Dec 22, 2024
1 parent abc3cee commit 22642ac
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions code/modules/power/lighting/light.dm
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@

/obj/machinery/light/proc/handle_fire(area/source, new_fire)
SIGNAL_HANDLER
update()
update(dont_burn_out = TRUE)

// update the icon_state and luminosity of the light depending on its state
/obj/machinery/light/proc/update(trigger = TRUE)
/obj/machinery/light/proc/update(trigger = TRUE, dont_burn_out = FALSE)
switch(status)
if(LIGHT_BROKEN,LIGHT_BURNED,LIGHT_EMPTY)
on = FALSE
Expand Down Expand Up @@ -230,19 +230,21 @@
brightness_set = bulb_outer_range * bulb_major_emergency_brightness_mul
var/matching = light && brightness_set == light.light_outer_range && power_set == light.light_power && color_set == light.light_color && FC == light.light_falloff_curve && IR == light.light_inner_range
if(!matching)
switchcount++
if( prob( min(60, (switchcount**2)*0.01) ) )
if(trigger)
var/should_set = TRUE
if(!dont_burn_out)
switchcount++
if(trigger && prob(min(60, (switchcount ** 2) * 0.01)))
burn_out()
else
should_set = FALSE
if(should_set)
use_power = ACTIVE_POWER_USE
set_light(
l_outer_range = brightness_set,
l_inner_range = IR,
l_power = power_set,
l_falloff_curve = FC,
l_color = color_set
)
)
else if(has_emergency_power(LIGHT_EMERGENCY_POWER_USE) && !turned_off())
use_power = IDLE_POWER_USE
low_power_mode = TRUE
Expand Down

0 comments on commit 22642ac

Please sign in to comment.