Better wrenching code

Probably
This commit is contained in:
SabreML
2020-08-11 05:34:53 +01:00
parent 5f6f54429d
commit 79b68e0696
3 changed files with 6 additions and 30 deletions
+2 -10
View File
@@ -65,17 +65,9 @@
/obj/structure/dresser/wrench_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
if(!I.tool_use_check(user, 0))
return
if(anchored)
WRENCH_UNANCHOR_MESSAGE
anchored = FALSE
else
if(!isfloorturf(loc))
to_chat(user, "<span class='warning'>A floor must be present to secure [src]!</span>")
return
WRENCH_ANCHOR_MESSAGE
anchored = TRUE
default_unfasten_wrench(user, I, time = 20)
obj/structure/dresser/deconstruct(disassembled = FALSE)
var/mat_drop = 15
+2 -10
View File
@@ -26,17 +26,9 @@
/obj/structure/loom/wrench_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
if(!I.tool_use_check(user, 0))
return
if(anchored)
WRENCH_UNANCHOR_MESSAGE
anchored = FALSE
else
if(!isfloorturf(loc))
to_chat(user, "<span class='warning'>A floor must be present to secure [src]!</span>")
return
WRENCH_ANCHOR_MESSAGE
anchored = TRUE
default_unfasten_wrench(user, I, time = 20)
/obj/structure/loom/deconstruct(disassembled = FALSE)
var/mat_drop = 5