mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 02:57:48 +01:00
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:
@@ -202,10 +202,7 @@
|
||||
if(on)
|
||||
to_chat(user, "<span class='warning'>Turn it off first!</span>")
|
||||
return
|
||||
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
|
||||
return
|
||||
anchored = !anchored
|
||||
to_chat(user, "<span class='notice'>You [anchored ? "wrench" : "unwrench"] [src].</span>")
|
||||
default_unfasten_wrench(user, I, 4 SECONDS)
|
||||
|
||||
/obj/machinery/atmospherics/portable/scrubber/huge/stationary
|
||||
name = "Stationary Air Scrubber"
|
||||
|
||||
@@ -86,13 +86,7 @@
|
||||
|
||||
/obj/machinery/bottler/wrench_act(mob/user, obj/item/I)
|
||||
. = TRUE
|
||||
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
|
||||
return
|
||||
anchored = !anchored
|
||||
if(anchored)
|
||||
WRENCH_ANCHOR_MESSAGE
|
||||
else
|
||||
WRENCH_UNANCHOR_MESSAGE
|
||||
default_unfasten_wrench(user, I, 0)
|
||||
|
||||
/obj/machinery/bottler/proc/insert_item(obj/item/O, mob/user)
|
||||
if(!O || !user)
|
||||
|
||||
@@ -203,6 +203,4 @@
|
||||
|
||||
/obj/machinery/cooker/deepfryer/wrench_act(mob/user, obj/item/I)
|
||||
. = TRUE
|
||||
if(!I.tool_use_check(user, 0))
|
||||
return
|
||||
default_unfasten_wrench(user, I, 30)
|
||||
|
||||
@@ -263,7 +263,5 @@
|
||||
|
||||
/obj/machinery/icemachine/wrench_act(mob/user, obj/item/I)
|
||||
. = TRUE
|
||||
if(!I.tool_use_check(user, 0))
|
||||
return
|
||||
default_unfasten_wrench(user, I, 30)
|
||||
|
||||
|
||||
@@ -129,12 +129,7 @@
|
||||
if(operating)
|
||||
return
|
||||
|
||||
I.play_tool_sound(src)
|
||||
if(anchored)
|
||||
to_chat(user, "<span class='alert'>[src] can now be moved.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='alert'>[src] is now secured.</span>")
|
||||
anchored = !anchored
|
||||
default_unfasten_wrench(user, I, 0)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/add_item(obj/item/I, mob/user)
|
||||
|
||||
@@ -158,8 +158,6 @@
|
||||
|
||||
/obj/machinery/smartfridge/wrench_act(mob/living/user, obj/item/I)
|
||||
. = default_unfasten_wrench(user, I, time = 4 SECONDS)
|
||||
if(.)
|
||||
power_change()
|
||||
|
||||
/obj/machinery/smartfridge/crowbar_act(mob/living/user, obj/item/I)
|
||||
. = default_deconstruction_crowbar(user, I)
|
||||
|
||||
@@ -901,24 +901,7 @@
|
||||
if(using_irrigation)
|
||||
to_chat(user, "<span class='warning'>Disconnect the hoses first!</span>")
|
||||
return
|
||||
|
||||
if(!anchored && !isinspace())
|
||||
user.visible_message("[user] begins to wrench [src] into place.", "<span class='notice'>You begin to wrench [src] in place...</span>")
|
||||
if(I.use_tool(src, user, 20, volume = I.tool_volume))
|
||||
if(anchored)
|
||||
return
|
||||
anchored = TRUE
|
||||
user.visible_message("[user] wrenches [src] into place.", \
|
||||
"<span class='notice'>You wrench [src] in place.</span>")
|
||||
else if(anchored)
|
||||
user.visible_message("[user] begins to unwrench [src].", \
|
||||
"<span class='notice'>You begin to unwrench [src]...</span>")
|
||||
if(I.use_tool(src, user, 20, volume = I.tool_volume))
|
||||
if(!anchored)
|
||||
return
|
||||
anchored = FALSE
|
||||
user.visible_message("[user] unwrenches [src].", \
|
||||
"<span class='notice'>You unwrench [src].</span>")
|
||||
default_unfasten_wrench(user, I)
|
||||
|
||||
/obj/machinery/hydroponics/attack_hand(mob/user)
|
||||
if(issilicon(user)) //How does AI know what plant is?
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
|
||||
/obj/machinery/power/teg/wrench_act(mob/user, obj/item/I)
|
||||
. = TRUE
|
||||
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
|
||||
if(!default_unfasten_wrench(user, I, 0))
|
||||
return
|
||||
anchored = !anchored
|
||||
if(!anchored)
|
||||
|
||||
@@ -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(..())
|
||||
|
||||
Reference in New Issue
Block a user