Refined earlier fix

Tried a couple of other solutions, but this ended up being the most reliable.

Now checks all areas associated with the firedoor to see if they should still be down.

Also makes a final check before closing the door in case the fire alarm turns off in the middle of an autoclose cycle.
This commit is contained in:
Loganbacca
2014-01-15 18:18:58 +13:00
parent 4953608bda
commit e145b61681
2 changed files with 10 additions and 5 deletions

View File

@@ -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)

View File

@@ -88,12 +88,11 @@
user << "<span class='warning'>Access denied.</span>"
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()