Fixes machine using power from the area it was created in, rather than using the area it is in (#23188)

* Update machine area when power_change() is called.

* Do not attempt to unregister from null powernet

* Move to wrench and update wrench_acts

* Remove accidental pseudocode

---------

Co-authored-by: Adrer <adrermail@gmail.com>
This commit is contained in:
Adrer
2023-11-20 14:10:23 -05:00
committed by GitHub
co-authored by Adrer
parent 5ac1cc817d
commit 39005bea2b
17 changed files with 21 additions and 87 deletions
@@ -294,14 +294,7 @@
/obj/machinery/chem_dispenser/wrench_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 4 SECONDS, volume = I.tool_volume))
return
if(anchored)
anchored = FALSE
WRENCH_UNANCHOR_MESSAGE
else if(!anchored)
anchored = TRUE
WRENCH_ANCHOR_MESSAGE
default_unfasten_wrench(user, I, 4 SECONDS)
/obj/machinery/chem_dispenser/attack_ai(mob/user)
return attack_hand(user)
@@ -148,9 +148,7 @@
/obj/machinery/chem_master/wrench_act(mob/user, obj/item/I)
if(panel_open)
return
if(default_unfasten_wrench(user, I, time = 4 SECONDS))
power_change()
return TRUE
default_unfasten_wrench(user, I, 4 SECONDS)
/obj/machinery/chem_master/ui_act(action, params, datum/tgui/ui, datum/ui_state/state)
if(..())