You no longer blugeon railings when unanchoring them. (#50090)

* No bludgeon railings no more

* autodoc
This commit is contained in:
nemvar
2020-03-21 09:48:50 -03:00
committed by GitHub
parent 860b513a5b
commit 6ce3d4d26f
+10 -7
View File
@@ -29,13 +29,16 @@
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
return
if(!(flags_1&NODECONSTRUCT_1))
if(I.tool_behaviour == TOOL_WRENCH)
to_chat(user, "<span class='notice'>You begin to [anchored ? "unfasten the railing from":"fasten the railing to"] the floor...</span>")
if(I.use_tool(src, user, volume = 75, extra_checks = CALLBACK(src, .proc/check_anchored, anchored)))
setAnchored(!anchored)
to_chat(user, "<span class='notice'>You [anchored ? "fasten the railing to":"unfasten the railing from"] the floor.</span>")
return
///Implements behaviour that makes it possible to unanchor the railing.
/obj/structure/railing/wrench_act(mob/living/user, obj/item/I)
. = ..()
if(flags_1&NODECONSTRUCT_1)
return
to_chat(user, "<span class='notice'>You begin to [anchored ? "unfasten the railing from":"fasten the railing to"] the floor...</span>")
if(I.use_tool(src, user, volume = 75, extra_checks = CALLBACK(src, .proc/check_anchored, anchored)))
setAnchored(!anchored)
to_chat(user, "<span class='notice'>You [anchored ? "fasten the railing to":"unfasten the railing from"] the floor.</span>")
return TRUE
/obj/structure/railing/proc/check_anchored(checked_anchored)
if(anchored == checked_anchored)