diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 6695fe4402..f69b2a35e3 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -100,6 +100,7 @@ return if( !fire ) fire = 1 + master.fire = 1 //used for firedoor checks updateicon() mouse_opacity = 0 for(var/obj/machinery/door/firedoor/D in all_doors) @@ -122,6 +123,7 @@ /area/proc/firereset() if (fire) fire = 0 + master.fire = 0 //used for firedoor checks mouse_opacity = 0 updateicon() for(var/obj/machinery/door/firedoor/D in all_doors) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index b7f78fd7c6..3fd77b8b34 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -88,12 +88,11 @@ user << "Access denied." return - var/area/A = get_area(src) - ASSERT(istype(A)) - /*if(A.master) // var/fire in master area never gets set, so will always be 0 - A = A.master*/ + var/alarmed = 0 - var/alarmed = (A.air_doors_activated || A.fire) + for(var/area/A in areas_added) //Checks if there are fire alarms in any areas associated with that firedoor + if(A.fire || A.air_doors_activated) + alarmed = 1 var/answer = alert(user, "Would you like to [density ? "open" : "close"] this [src.name]?[ alarmed && density ? "\nNote that by doing so, you acknowledge any damages from opening this\n[src.name] as being your own fault, and you will be held accountable under the law." : ""]",\ "\The [src]", "Yes, [density ? "open" : "close"]", "No") @@ -115,6 +114,10 @@ if(needs_to_close) spawn(50) + alarmed = 0 + for(var/area/A in areas_added) //Just in case a fire alarm is turned off while the firedoor is going through an autoclose cycle + if(A.fire || A.air_doors_activated) + alarmed = 1 if(alarmed) nextstate = CLOSED close()