From 1a12e6488822f71e4994dcd0d58a8e808b247f5c Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 8 Mar 2021 02:30:00 +0100 Subject: [PATCH] [MIRROR] plastic flap air wall fix (#3978) * plastic flap air wall fix (#57455) Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> * plastic flap air wall fix Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com> --- code/game/objects/structures/plasticflaps.dm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/code/game/objects/structures/plasticflaps.dm b/code/game/objects/structures/plasticflaps.dm index cf801cee0f9..3bed7bfe444 100644 --- a/code/game/objects/structures/plasticflaps.dm +++ b/code/game/objects/structures/plasticflaps.dm @@ -29,14 +29,19 @@ return TRUE add_fingerprint(user) var/action = anchored ? "unscrews [src] from" : "screws [src] to" - var/uraction = anchored ? "unscrew [src] from " : "screw [src] to" + var/uraction = anchored ? "unscrew [src] from" : "screw [src] to" user.visible_message("[user] [action] the floor.", "You start to [uraction] the floor...", "You hear rustling noises.") - if(W.use_tool(src, user, 100, volume=100, extra_checks = CALLBACK(src, .proc/check_anchored_state, anchored))) - set_anchored(!anchored) - to_chat(user, "You [anchored ? "unscrew" : "screw"] [src] from the floor.") - return TRUE - else + if(!W.use_tool(src, user, 100, volume=100, extra_checks = CALLBACK(src, .proc/check_anchored_state, anchored))) return TRUE + set_anchored(!anchored) + update_atmos_behaviour() + air_update_turf(TRUE) + to_chat(user, "You [uraction] the floor.") + return TRUE + +///Update the flaps behaviour to gases, if not anchored will let air pass through +/obj/structure/plasticflaps/proc/update_atmos_behaviour() + CanAtmosPass = anchored ? ATMOS_PASS_YES : ATMOS_PASS_NO /obj/structure/plasticflaps/wirecutter_act(mob/living/user, obj/item/W) . = ..()