From fbf40a2cff6dd648f8860ae6d06d89cff59fc907 Mon Sep 17 00:00:00 2001 From: HelmCrab <90987989+Thera-Pissed@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:28:50 -0600 Subject: [PATCH] moves scrubbers off auto_use_power() --- code/game/machinery/_machinery.dm | 6 +++--- .../components/unary_devices/vent_scrubber.dm | 13 ++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 0b23e3b3aa7f..613b0957135d 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -44,7 +44,7 @@ Class Procs: auto_use_power() 'game/machinery/machine.dm' This proc determines how power mode power is deducted by the machine. 'auto_use_power()' is called by the 'master_controller' game_controller every - tick. + tick. (not anymore) Return Value: return:1 -- if object is powered @@ -278,7 +278,7 @@ Class Procs: updateUsrDialog() update_appearance() -/obj/machinery/proc/auto_use_power() +/*/obj/machinery/proc/auto_use_power() //obsolete, tick controller doesn't call this anymore because machines use addStaticPower now. if(!powered(power_channel)) return 0 if(use_power == 1) @@ -286,7 +286,7 @@ Class Procs: else if(use_power >= 2) use_power(active_power_usage,power_channel) return 1 - +*/ ///Called when we want to change the value of the `is_operational` variable. Boolean. /obj/machinery/proc/set_is_operational(new_value) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm index 0e5e7dc1c74a..4b8a31d7eb10 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm @@ -48,8 +48,8 @@ radio_connection = null adjacent_turfs.Cut() return ..() - -/obj/machinery/atmospherics/components/unary/vent_scrubber/auto_use_power() +/* +/obj/machinery/atmospherics/components/unary/vent_scrubber/auto_use_power() //auto_use_power no longer called if(!on || welded || !is_operational || !powered(power_channel)) return FALSE @@ -64,7 +64,7 @@ amount += amount * (adjacent_turfs.len * (adjacent_turfs.len / 2)) use_power(amount, power_channel) return TRUE - +*/ /obj/machinery/atmospherics/components/unary/vent_scrubber/update_icon_nopipes() cut_overlays() if(showpipe) @@ -138,13 +138,20 @@ ..() if(welded || !on || !is_operational) + if(use_static_power != NO_POWER_USE) + set_no_power() return FALSE if(!nodes[1]) return FALSE scrub(loc) if(widenet) + if(use_static_power != ACTIVE_POWER_USE) + set_active_power() for(var/turf/tile in adjacent_turfs) scrub(tile) + else + if(use_static_power != IDLE_POWER_USE) + set_idle_power() return TRUE /obj/machinery/atmospherics/components/unary/vent_scrubber/proc/scrub(turf/tile)