Files
Bubberstation/code/controllers/subsystem/adjacent_air.dm
SkyratBot 230a34588f [MIRROR] modules/atmospherics major cleanup [MDB IGNORE] (#8818)
* modules/atmospherics major cleanup

* E

* E

* 0

Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-10-14 22:44:30 +01:00

42 lines
985 B
Plaintext

SUBSYSTEM_DEF(adjacent_air)
name = "Atmos Adjacency"
flags = SS_BACKGROUND
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
wait = 10
priority = FIRE_PRIORITY_ATMOS_ADJACENCY
var/list/queue = list()
/datum/controller/subsystem/adjacent_air/stat_entry(msg)
#ifdef TESTING
msg = "P:[length(queue)], S:[GLOB.atmos_adjacent_savings[1]], T:[GLOB.atmos_adjacent_savings[2]]"
#else
msg = "P:[length(queue)]"
#endif
return ..()
/datum/controller/subsystem/adjacent_air/Initialize()
while(length(queue))
fire(mc_check = FALSE)
return ..()
/datum/controller/subsystem/adjacent_air/fire(resumed = FALSE, mc_check = TRUE)
var/list/queue = src.queue
while (length(queue))
var/turf/currT = queue[1]
var/goal = queue[currT]
queue.Cut(1,2)
currT.immediate_calculate_adjacent_turfs()
if(goal == MAKE_ACTIVE)
SSair.add_to_active(currT)
else if(goal == KILL_EXCITED)
SSair.add_to_active(currT, TRUE)
if(mc_check)
if(MC_TICK_CHECK)
break
else
CHECK_TICK