Fixes airtight plastic flaps stopping working after shuttles moves (#15687)

This commit is contained in:
Alberyk
2023-01-30 12:22:31 +01:00
committed by GitHub
parent 3f545ae8f3
commit 676bbc3cd6
2 changed files with 41 additions and 26 deletions
+35 -26
View File
@@ -8,6 +8,9 @@
layer = 4
explosion_resistance = 5
build_amt = 4
atmos_canpass = CANPASS_PROC
var/manipulating = FALSE //Prevents queueing up a ton of deconstructs
var/list/mobs_can_pass = list(
/mob/living/carbon/slime,
@@ -15,10 +18,34 @@
/mob/living/silicon/robot/drone
)
var/airtight = FALSE
/obj/structure/plasticflaps/Initialize()
. = ..()
material = SSmaterials.get_material_by_name(MATERIAL_PLASTIC)
/obj/structure/plasticflaps/Destroy()
if(airtight)
clear_airtight()
. = ..()
/obj/structure/plasticflaps/proc/become_airtight()
airtight = TRUE
var/turf/simulated/floor/T = get_turf(loc)
if(istype(T))
update_nearby_tiles()
/obj/structure/plasticflaps/proc/clear_airtight()
airtight = FALSE
var/turf/simulated/floor/T = get_turf(loc)
if(istype(T))
update_nearby_tiles()
/obj/structure/plasticflaps/c_airblock()
if(airtight)
return AIR_BLOCKED
return FALSE
/obj/structure/plasticflaps/CanPass(atom/A, turf/T)
if(istype(A) && A.checkpass(PASSGLASS))
return prob(60)
@@ -67,40 +94,22 @@
/obj/structure/plasticflaps/mining //A specific type for mining that doesn't allow airflow because of them damn crates
name = "airtight plastic flaps"
desc = "Heavy duty, airtight, plastic flaps."
airtight = TRUE
/obj/structure/plasticflaps/mining/Initialize() //set the turf below the flaps to block air
..()
var/turf/T = get_turf(loc)
if(T)
T.blocks_air = 1
/obj/structure/plasticflaps/mining/Destroy() //lazy hack to set the turf to allow air to pass if it's a simulated floor
var/turf/T = get_turf(loc)
if(T)
if(istype(T, /turf/simulated/floor))
T.blocks_air = 0
return ..()
/obj/structure/plasticflaps/mining/Initialize()
. = ..()
update_nearby_tiles()
//Airtight plastic flaps made for the kitchen freezer, blocks atmos but not movement
/obj/structure/plasticflaps/airtight
name = "airtight plastic flaps"
desc = "Heavy duty, airtight, plastic flaps."
layer = 3
airtight = TRUE
/obj/structure/plasticflaps/airtight/Initialize() //set the turf below the flaps to block air
..()
var/turf/T = get_turf(loc)
if(T)
T.blocks_air = 1
/obj/structure/plasticflaps/airtight/Destroy() //lazy hack to set the turf to allow air to pass if it's a simulated floor
var/turf/T = get_turf(loc)
if(T)
if(istype(T, /turf/simulated/floor))
T.blocks_air = 0
return ..()
/obj/structure/plasticflaps/airtight/Initialize()
. = ..()
update_nearby_tiles()
/obj/structure/plasticflaps/airtight/CanPass(atom/A, turf/T)
return 1//Blocks nothing except air