Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 7ef9c77

Browse files
authored
Update plasticflaps.dm (#22724)
1 parent 49ff2b2 commit 7ef9c77

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

code/game/objects/structures/plasticflaps.dm

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
. = ..()
1616
alpha = 0
1717
gen_overlay()
18+
air_update_turf()
1819

1920
/obj/structure/plasticflaps/on_changed_z_level(turf/old_turf, turf/new_turf, same_z_layer, notify_contents)
2021
if(same_z_layer)
@@ -40,14 +41,19 @@
4041
return TRUE
4142
add_fingerprint(user)
4243
var/action = anchored ? "unscrews [src] from" : "screws [src] to"
43-
var/uraction = anchored ? "unscrew [src] from " : "screw [src] to"
44+
var/uraction = anchored ? "unscrew [src] from" : "screw [src] to"
4445
user.visible_message(span_warning("[user] [action] the floor."), span_notice("You start to [uraction] the floor..."), "You hear rustling noises.")
45-
if(W.use_tool(src, user, 100, volume=100, extra_checks = CALLBACK(src, PROC_REF(check_anchored_state), anchored)))
46-
setAnchored(!anchored)
47-
to_chat(user, span_notice(" You [anchored ? "unscrew" : "screw"] [src] from the floor."))
48-
return TRUE
49-
else
46+
if(!W.use_tool(src, user, 100, volume=100, extra_checks = CALLBACK(src, PROC_REF(check_anchored_state), anchored)))
5047
return TRUE
48+
setAnchored(!anchored)
49+
update_atmos_behaviour()
50+
air_update_turf()
51+
to_chat(user, span_notice(" You [anchored ? "unscrew" : "screw"] [src] from the floor."))
52+
return TRUE
53+
54+
///Update the flaps behaviour to gases, if not anchored will let air pass through
55+
/obj/structure/plasticflaps/proc/update_atmos_behaviour()
56+
can_atmos_pass = anchored ? ATMOS_PASS_YES : ATMOS_PASS_NO
5157

5258
/obj/structure/plasticflaps/wirecutter_act(mob/living/user, obj/item/W)
5359
if(!anchored)
@@ -113,10 +119,6 @@
113119
new /obj/item/stack/sheet/plastic/five(loc)
114120
qdel(src)
115121

116-
/obj/structure/plasticflaps/Initialize(mapload)
117-
. = ..()
118-
air_update_turf()
119-
120122
/obj/structure/plasticflaps/Destroy()
121123
var/atom/oldloc = loc
122124
. = ..()

0 commit comments

Comments
 (0)