Skip to content

Commit 22642ac

Browse files
authored
Fire alarms no longer burn out lights (#4636)
1 parent abc3cee commit 22642ac

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

code/modules/power/lighting/light.dm

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@
196196

197197
/obj/machinery/light/proc/handle_fire(area/source, new_fire)
198198
SIGNAL_HANDLER
199-
update()
199+
update(dont_burn_out = TRUE)
200200

201201
// update the icon_state and luminosity of the light depending on its state
202-
/obj/machinery/light/proc/update(trigger = TRUE)
202+
/obj/machinery/light/proc/update(trigger = TRUE, dont_burn_out = FALSE)
203203
switch(status)
204204
if(LIGHT_BROKEN,LIGHT_BURNED,LIGHT_EMPTY)
205205
on = FALSE
@@ -230,19 +230,21 @@
230230
brightness_set = bulb_outer_range * bulb_major_emergency_brightness_mul
231231
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
232232
if(!matching)
233-
switchcount++
234-
if( prob( min(60, (switchcount**2)*0.01) ) )
235-
if(trigger)
233+
var/should_set = TRUE
234+
if(!dont_burn_out)
235+
switchcount++
236+
if(trigger && prob(min(60, (switchcount ** 2) * 0.01)))
236237
burn_out()
237-
else
238+
should_set = FALSE
239+
if(should_set)
238240
use_power = ACTIVE_POWER_USE
239241
set_light(
240242
l_outer_range = brightness_set,
241243
l_inner_range = IR,
242244
l_power = power_set,
243245
l_falloff_curve = FC,
244246
l_color = color_set
245-
)
247+
)
246248
else if(has_emergency_power(LIGHT_EMERGENCY_POWER_USE) && !turned_off())
247249
use_power = IDLE_POWER_USE
248250
low_power_mode = TRUE

0 commit comments

Comments
 (0)