Skip to content

Commit

Permalink
Emergency lights turn off after 2 minutes again (#28517)
Browse files Browse the repository at this point in the history
* Emergency power now turns off again

* Clarity Typo fix
  • Loading branch information
ExusA authored Feb 26, 2025
1 parent 202249a commit f44ee1d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions code/modules/power/apc/apc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -477,18 +477,20 @@
machine_powernet.set_power_channel(PW_CHANNEL_LIGHTING, (lighting_channel > APC_CHANNEL_SETTING_AUTO_OFF))
machine_powernet.set_power_channel(PW_CHANNEL_EQUIPMENT, (equipment_channel > APC_CHANNEL_SETTING_AUTO_OFF))
machine_powernet.set_power_channel(PW_CHANNEL_ENVIRONMENT, (environment_channel > APC_CHANNEL_SETTING_AUTO_OFF))
if(lighting_channel)
if(lighting_channel > APC_CHANNEL_SETTING_AUTO_OFF)
emergency_power = TRUE
if(emergency_power_timer)
deltimer(emergency_power_timer)
emergency_power_timer = null
else
emergency_power_timer = addtimer(CALLBACK(src, PROC_REF(turn_emergency_power_off)), 2 MINUTES, TIMER_UNIQUE|TIMER_STOPPABLE)
if(!emergency_power_timer)
emergency_power_timer = addtimer(CALLBACK(src, PROC_REF(turn_emergency_power_off)), 2 MINUTES, TIMER_UNIQUE|TIMER_STOPPABLE)
else
machine_powernet.set_power_channel(PW_CHANNEL_LIGHTING, FALSE)
machine_powernet.set_power_channel(PW_CHANNEL_EQUIPMENT, FALSE)
machine_powernet.set_power_channel(PW_CHANNEL_ENVIRONMENT, FALSE)
emergency_power_timer = addtimer(CALLBACK(src, PROC_REF(turn_emergency_power_off)), 2 MINUTES, TIMER_UNIQUE|TIMER_STOPPABLE)
if(!emergency_power_timer)
emergency_power_timer = addtimer(CALLBACK(src, PROC_REF(turn_emergency_power_off)), 2 MINUTES, TIMER_UNIQUE|TIMER_STOPPABLE)
machine_powernet.power_change()

/obj/machinery/power/apc/proc/can_use(mob/user, loud = 0) //used by attack_hand() and Topic()
Expand Down

0 comments on commit f44ee1d

Please sign in to comment.