Skip to content

Commit

Permalink
Scrubbers and Vents will no longer reset their settings on map load. (t…
Browse files Browse the repository at this point in the history
…gstation#78582)

## About The Pull Request

Scrubbers and Vents will no longer reset their settings on map load.

## Why It's Good For The Game

On map load, vents and scrubbers would be set to filtering, overriding
any map-edited settings of scrubbers/vents or unique subtypes of
scrubbers/vents, such as siphoning vents.

## Changelog

:cl: BurgerBB
fix: Scrubbers and Vents will no longer reset their settings on map
load.
/:cl:
  • Loading branch information
BurgerLUA authored Sep 28, 2023
1 parent 63a2762 commit 2627605
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions code/modules/atmospherics/machinery/air_alarm/_air_alarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ GLOBAL_LIST_EMPTY_TYPED(air_alarms, /obj/machinery/airalarm)

my_area = connected_sensor ? get_area(connected_sensor) : get_area(src)
alarm_manager = new(src)
select_mode(src, /datum/air_alarm_mode/filtering)
select_mode(src, /datum/air_alarm_mode/filtering, should_apply = FALSE)

AddElement(/datum/element/connect_loc, atmos_connections)
AddComponent(/datum/component/usb_port, list(
Expand Down Expand Up @@ -587,14 +587,15 @@ GLOBAL_LIST_EMPTY_TYPED(air_alarms, /obj/machinery/airalarm)

selected_mode.replace(my_area, pressure)

/obj/machinery/airalarm/proc/select_mode(atom/source, datum/air_alarm_mode/mode_path)
/obj/machinery/airalarm/proc/select_mode(atom/source, datum/air_alarm_mode/mode_path, should_apply = TRUE)
var/datum/air_alarm_mode/new_mode = GLOB.air_alarm_modes[mode_path]
if(!new_mode)
return
if(new_mode.emag && !(obj_flags & EMAGGED))
return
selected_mode = new_mode
selected_mode.apply(my_area)
if(should_apply)
selected_mode.apply(my_area)
SEND_SIGNAL(src, COMSIG_AIRALARM_UPDATE_MODE, source)

MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/airalarm, 27)
Expand Down

0 comments on commit 2627605

Please sign in to comment.