From 9a18a362459056341dfe8e37428f102722e54b4c Mon Sep 17 00:00:00 2001 From: QuoteFox <49098813+quotefox@users.noreply.github.com> Date: Fri, 23 Apr 2021 19:10:24 +0100 Subject: [PATCH] bug fix airlock. --- code/game/machinery/doors/airlock.dm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index de879025..f786cbbc 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -161,18 +161,19 @@ /obj/machinery/door/airlock/proc/autorotation() //for auto rotating doors, because im sick of doing it - var/turf/T = get_step(src, NORTH) //get the tile NORTH - if(istype(T, /turf/closed)) //its a wall - dir = 4 - if(istype(T, /obj/structure/window)) //its a window - dir = 4 + var/turf/N = get_step(src, NORTH) + var/turf/S = get_step(src, SOUTH) - var/turf/S = get_step(src, SOUTH) //get the tile NORTH - if(istype(S, /turf/closed)) //its a wall + if(istype(N, /turf/closed)) //Wall dir = 4 - if(istype(S, /obj/structure/window)) //its a window + if(istype(S, /turf/closed)) + dir = 4 + var/obj/structure/window/W = locate(/obj/structure/window, N) //Window + if(W) + dir = 4 + var/obj/structure/window/R = locate(/obj/structure/window, S) + if(R) dir = 4 - /obj/machinery/door/airlock/ComponentInitialize() . = ..()