Skip to content

Commit

Permalink
moves scrubbers off auto_use_power()
Browse files Browse the repository at this point in the history
  • Loading branch information
Thera-Pissed committed Jan 12, 2024
1 parent 478d0db commit fbf40a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions code/game/machinery/_machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -278,15 +278,15 @@ 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)
use_power(idle_power_usage,power_channel)
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fbf40a2

Please sign in to comment.