mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Merge pull request #3410 from VOREStation/fix-area-firedoors
Area alarms should not fight each other for control of fire doors.
This commit is contained in:
@@ -49,7 +49,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
|
|||||||
var/no_air = null
|
var/no_air = null
|
||||||
// var/list/lights // list of all lights on this area
|
// var/list/lights // list of all lights on this area
|
||||||
var/list/all_doors = list() //Added by Strumpetplaya - Alarm Change - Contains a list of doors adjacent to this area
|
var/list/all_doors = list() //Added by Strumpetplaya - Alarm Change - Contains a list of doors adjacent to this area
|
||||||
var/air_doors_activated = 0
|
var/firedoors_closed = 0
|
||||||
var/list/ambience = list('sound/ambience/ambigen1.ogg','sound/ambience/ambigen3.ogg','sound/ambience/ambigen4.ogg','sound/ambience/ambigen5.ogg','sound/ambience/ambigen6.ogg','sound/ambience/ambigen7.ogg','sound/ambience/ambigen8.ogg','sound/ambience/ambigen9.ogg','sound/ambience/ambigen10.ogg','sound/ambience/ambigen11.ogg','sound/ambience/ambigen12.ogg','sound/ambience/ambigen14.ogg')
|
var/list/ambience = list('sound/ambience/ambigen1.ogg','sound/ambience/ambigen3.ogg','sound/ambience/ambigen4.ogg','sound/ambience/ambigen5.ogg','sound/ambience/ambigen6.ogg','sound/ambience/ambigen7.ogg','sound/ambience/ambigen8.ogg','sound/ambience/ambigen9.ogg','sound/ambience/ambigen10.ogg','sound/ambience/ambigen11.ogg','sound/ambience/ambigen12.ogg','sound/ambience/ambigen14.ogg')
|
||||||
var/list/forced_ambience = null
|
var/list/forced_ambience = null
|
||||||
var/sound_env = STANDARD_STATION
|
var/sound_env = STANDARD_STATION
|
||||||
|
|||||||
@@ -53,22 +53,28 @@
|
|||||||
danger_level = max(danger_level, AA.danger_level)
|
danger_level = max(danger_level, AA.danger_level)
|
||||||
|
|
||||||
if(danger_level != atmosalm)
|
if(danger_level != atmosalm)
|
||||||
if (danger_level < 1 && atmosalm >= 1)
|
|
||||||
//closing the doors on red and opening on green provides a bit of hysteresis that will hopefully prevent fire doors from opening and closing repeatedly due to noise
|
|
||||||
air_doors_open()
|
|
||||||
else if (danger_level >= 2 && atmosalm < 2)
|
|
||||||
air_doors_close()
|
|
||||||
|
|
||||||
atmosalm = danger_level
|
atmosalm = danger_level
|
||||||
|
//closing the doors on red and opening on green provides a bit of hysteresis that will hopefully prevent fire doors from opening and closing repeatedly due to noise
|
||||||
|
if (danger_level < 1 || danger_level >= 2)
|
||||||
|
firedoors_update()
|
||||||
|
|
||||||
for (var/obj/machinery/alarm/AA in src)
|
for (var/obj/machinery/alarm/AA in src)
|
||||||
AA.update_icon()
|
AA.update_icon()
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
/area/proc/air_doors_close()
|
// Either close or open firedoors depending on current alert statuses
|
||||||
if(!air_doors_activated)
|
/area/proc/firedoors_update()
|
||||||
air_doors_activated = 1
|
if(fire || party || atmosalm)
|
||||||
|
firedoors_close()
|
||||||
|
else
|
||||||
|
firedoors_open()
|
||||||
|
|
||||||
|
// Close all firedoors in the area
|
||||||
|
/area/proc/firedoors_close()
|
||||||
|
if(!firedoors_closed)
|
||||||
|
firedoors_closed = TRUE
|
||||||
for(var/obj/machinery/door/firedoor/E in all_doors)
|
for(var/obj/machinery/door/firedoor/E in all_doors)
|
||||||
if(!E.blocked)
|
if(!E.blocked)
|
||||||
if(E.operating)
|
if(E.operating)
|
||||||
@@ -77,9 +83,10 @@
|
|||||||
spawn(0)
|
spawn(0)
|
||||||
E.close()
|
E.close()
|
||||||
|
|
||||||
/area/proc/air_doors_open()
|
// Open all firedoors in the area
|
||||||
if(air_doors_activated)
|
/area/proc/firedoors_open()
|
||||||
air_doors_activated = 0
|
if(firedoors_closed)
|
||||||
|
firedoors_closed = FALSE
|
||||||
for(var/obj/machinery/door/firedoor/E in all_doors)
|
for(var/obj/machinery/door/firedoor/E in all_doors)
|
||||||
if(!E.blocked)
|
if(!E.blocked)
|
||||||
if(E.operating)
|
if(E.operating)
|
||||||
@@ -93,27 +100,13 @@
|
|||||||
if(!fire)
|
if(!fire)
|
||||||
fire = 1 //used for firedoor checks
|
fire = 1 //used for firedoor checks
|
||||||
updateicon()
|
updateicon()
|
||||||
mouse_opacity = 0
|
firedoors_update()
|
||||||
for(var/obj/machinery/door/firedoor/D in all_doors)
|
|
||||||
if(!D.blocked)
|
|
||||||
if(D.operating)
|
|
||||||
D.nextstate = FIREDOOR_CLOSED
|
|
||||||
else if(!D.density)
|
|
||||||
spawn()
|
|
||||||
D.close()
|
|
||||||
|
|
||||||
/area/proc/fire_reset()
|
/area/proc/fire_reset()
|
||||||
if (fire)
|
if (fire)
|
||||||
fire = 0 //used for firedoor checks
|
fire = 0 //used for firedoor checks
|
||||||
updateicon()
|
updateicon()
|
||||||
mouse_opacity = 0
|
firedoors_update()
|
||||||
for(var/obj/machinery/door/firedoor/D in all_doors)
|
|
||||||
if(!D.blocked)
|
|
||||||
if(D.operating)
|
|
||||||
D.nextstate = FIREDOOR_OPEN
|
|
||||||
else if(D.density)
|
|
||||||
spawn(0)
|
|
||||||
D.open()
|
|
||||||
|
|
||||||
/area/proc/readyalert()
|
/area/proc/readyalert()
|
||||||
if(!eject)
|
if(!eject)
|
||||||
@@ -131,21 +124,14 @@
|
|||||||
if (!( party ))
|
if (!( party ))
|
||||||
party = 1
|
party = 1
|
||||||
updateicon()
|
updateicon()
|
||||||
mouse_opacity = 0
|
firedoors_update()
|
||||||
return
|
return
|
||||||
|
|
||||||
/area/proc/partyreset()
|
/area/proc/partyreset()
|
||||||
if (party)
|
if (party)
|
||||||
party = 0
|
party = 0
|
||||||
mouse_opacity = 0
|
|
||||||
updateicon()
|
updateicon()
|
||||||
for(var/obj/machinery/door/firedoor/D in src)
|
firedoors_update()
|
||||||
if(!D.blocked)
|
|
||||||
if(D.operating)
|
|
||||||
D.nextstate = FIREDOOR_OPEN
|
|
||||||
else if(D.density)
|
|
||||||
spawn(0)
|
|
||||||
D.open()
|
|
||||||
return
|
return
|
||||||
|
|
||||||
/area/proc/updateicon()
|
/area/proc/updateicon()
|
||||||
|
|||||||
@@ -719,9 +719,9 @@
|
|||||||
if(href_list["atmos_unlock"])
|
if(href_list["atmos_unlock"])
|
||||||
switch(href_list["atmos_unlock"])
|
switch(href_list["atmos_unlock"])
|
||||||
if("0")
|
if("0")
|
||||||
alarm_area.air_doors_close()
|
alarm_area.firedoors_close()
|
||||||
if("1")
|
if("1")
|
||||||
alarm_area.air_doors_open()
|
alarm_area.firedoors_open()
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if(href_list["atmos_alarm"])
|
if(href_list["atmos_alarm"])
|
||||||
|
|||||||
@@ -141,7 +141,7 @@
|
|||||||
|
|
||||||
var/alarmed = lockdown
|
var/alarmed = lockdown
|
||||||
for(var/area/A in areas_added) //Checks if there are fire alarms in any areas associated with that firedoor
|
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)
|
if(A.firedoors_closed)
|
||||||
alarmed = 1
|
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." : ""]",\
|
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." : ""]",\
|
||||||
@@ -179,7 +179,7 @@
|
|||||||
spawn(50)
|
spawn(50)
|
||||||
alarmed = 0
|
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
|
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)
|
if(A.firedoors_closed)
|
||||||
alarmed = 1
|
alarmed = 1
|
||||||
if(alarmed)
|
if(alarmed)
|
||||||
nextstate = FIREDOOR_CLOSED
|
nextstate = FIREDOOR_CLOSED
|
||||||
|
|||||||
4
html/changelogs/Leshana - Firedoors.yml
Normal file
4
html/changelogs/Leshana - Firedoors.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
author: Leshana
|
||||||
|
delete-after: True
|
||||||
|
changes:
|
||||||
|
- bugfix: "Resetting a fire alert will no longer open firedoors if atmos alert is in effect and vice versa"
|
||||||
Reference in New Issue
Block a user