mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* why no work angy * weird errors shit sucks * fixved it I can spell good * fix? POSSIBLY * nope wasnt this * no more immutable thhanks koffee * ok ok * removes all the pref stuff ""removes"" * remove this idiot * this goes bye bye * these go too genius * bye bye * better night vision * tries to fix camera maybe * ok fuck it we ball we ball * ok lets go back go back go back go back * WORK DAMNIT * ha fuc kyou * this maybe * this doesnt work :( * maybe fix maybe * fucks everything why do i do this * test update test * Revert "tries to fix camera" This reverts commit2d14fbae66. * reverts everything I just did peko pain * bye bitch * oh yeah add this I guess * Fucks up the camera net + chunk why * test maybe revert * Revert "test maybe revert" This reverts commit98c5ef1b93. * Revert "Fucks up the camera net + chunk" This reverts commit0e421ebf5f. * this isnt going well uh oh * Attempts to rework out security camera and probably more * Revert "this isnt going well" This reverts commit1d8ceac867. * Revert "Revert "this isnt going well"" This reverts commite26fb61415. * ok ok * Revert "ok" This reverts commit7e7a7f8372. * Revert "Merge remote-tracking branch 'upstream/master' into NahI'dPortit" This reverts commit01094731c1, reversing changes made toc0cf69ebf1. * this doesn't need to be redefined I guess * no we need this totally * a familiar pain * 515 is L * yeah yeah * ok god fine * bye bye basemap :( doesnt work on runtime station * Fixes AI statis not working god im good * remove this oh god * Revert "Revert "Merge remote-tracking branch 'upstream/master' into NahI'dPortit"" This reverts commitb3fb3ba0db. * proves to god I exist and im pissed * yog exclusive feature (tm) plane master * bring this back from previous push * updates vendor emissives as well as firealarms * Updates barsign and fucks everything up * Fixes barsigns breaks all lights and updates barsigns to be machines and not structures We will address this in a later patch * not sure who changed that oh well * yeah this got moved * this needs updating yeah * turns off the carbon monoxide alarm duh * FIXES IT YES thank you biome * turns this off too yeah * Can't compile yet but ports a ton of shit * L * the game opens ig * extra shit * fixes * signals and smooth queue * look ma im going horribly out of scope * fixes chasms * this fixed nothing * ??? * more barsigns for later * forgive me cowboy. also fuck diagonals * oops we need this apparently * fuck it we ball * Update _lists.dm * Update icon_smoothing.dm * it now works kinda * Update atom_initializing_EXPENSIVE.dm * lighting don't work * we have light * sort turfs better * big fucking reorganize * like everything except templates * boy i sure hope nothing bad happens to these bar templates * we're back * no runtimes baby * no errors * shuttles are almost fixed i think * Revert "shuttles are almost fixed i think" This reverts commit046058827c. * Revert "Merge remote-tracking branch 'upstream/master' into icon_smoothing" This reverts commit863e1b776d, reversing changes made to884623e600. * Revert "no errors" This reverts commit884623e600. * too far back i think * midround smoothing runtimes fixed i think * comment cleanup * should fix the component runtimes * Revert "Revert "Merge remote-tracking branch 'upstream/master' into icon_smoothing"" This reverts commita8ff8d63aa. * NO RUNTIMES AND ICEMETA WORKS LET'S GOOOOOO * please stay fixed icemeta * organizing render dms * woops this too in the reorganizing * cryo fixed * nah, i'd win * parallax isn't my problem * pls don't break icemeta * runtime station gets a cam console * well it compiles * maybe fix the map * woops * man i hate maps * was that it? * PLEASE * missing focus tests * maybe that was it * maybe * let's take the batteries out of the carbon monoxide detector * fuck osha * i hate vending machines * that's not a computer * slot machine fix * PLEASE * that wasn't supposed to be there * fuck it i can't fix everything at once * BLUESPACE LOCKER? * literally why * hhh * does this fix chasms? * that should fix bad index * please? * turf_flags for reservations * haha oops * yolo (kill me) * fix wood walls and other walls * fix stairs * that might have fixed shittles * baseturfs are good now i think * should fix plasma windows * decals fixed * please fix changelog * shuttle lighting still fucky * lighting is stinky slow and doesn't finish updating by the time the server starts guh * lighting seemingly works * slipping works * shuttle sounds, slips, and windoors fixed * why am i here * fuck the changelog * of course someone touched smoothing as i'm almost done * we good? * updating ai_eye and rename * z updates and more ai cam updates * ice fixed * weather and ice fix * clockies can see and other clean up catches * windows fixed * cowbot forgive me i'm trying to update flashlights to tg because there's no light on lower multi-z z's like ice meta bottom floor * movable lighting works on multi-z * gps fix * item stacking from drag works * falsewall fix * job panel fixed * AI HANDLED * woops that comment should be gone * i hate ai i hate ai * brass glass visible again * vents on top of tiles now * sigdrobe sprite back * centcomm portals work * portals and see openspace mapping icons fixed * icemeta my behated * kill * is that it * lighting cutoff is old hat * angery overlay * not super necessary * also extra but whatever * ticker but thicker * job fix i hope * this isn't needed anymore * latejoin fix? * laserpointer, pipecrawl, and some consoles fixed * i hate fixing bugs as they're made * we're not ready for that * redef cleanup * gps arrows, gun flashlights, shuttle console placement, multi-z pulling fixed * goofy ah gun code * this was a good idea and necessary * should fix caltrop component * does this please the linter * linter please accept this async function * THERE * take the batteries out * make it stop * cowbot stopped me from letting ghosts dab * recycler loc fix * fix border firedoors not blocking movement * should fix screen fade out and fade in on round start and end * darker command tile trim and fixed bronze wall sprites * fuck you linter * railings actually stop you from leaving * probably fixes gibtonite overlay when struck * armaments dispenser and clockwork catwalk * turbine fix probably * pointing at inhand items should be fixed * fix overwatch app * should hopefully fix cable rotation on shuttle move * flashlights have better directionality logic * hopefully fixes shuttle atmos on move * grilles fixed * hopefully this fixes shuttle buttons, airolocks, and other machinery not working after moving * ice meta mining area finally not freezing * fix lightbulb icons not updating * lava mask and lighting dots * we actually have this * fuck glowshrooms GC * fix light fixture interactions and icon updates * hopefully catches all the updates * lava lighting good to go * seclite was missing inhands * smoothing in replays * light updates accurate in replays * biome's multi-z requests --------- Co-authored-by: cowbot92 <75333826+cowbot92@users.noreply.github.com> Co-authored-by: Molti <gamingjoelouis@gmail.com> Co-authored-by: Ringalong <53777086+JohnFulpWillard@users.noreply.github.com>
487 lines
15 KiB
Plaintext
487 lines
15 KiB
Plaintext
SUBSYSTEM_DEF(air)
|
|
name = "Atmospherics"
|
|
init_order = INIT_ORDER_AIR
|
|
priority = FIRE_PRIORITY_AIR
|
|
wait = 0.5 SECONDS
|
|
flags = SS_BACKGROUND
|
|
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
|
loading_points = 10 SECONDS // Yogs -- loading times
|
|
|
|
var/cached_cost = 0
|
|
|
|
var/cost_turfs = 0
|
|
var/cost_adjacent = 0
|
|
var/cost_groups = 0
|
|
var/cost_highpressure = 0
|
|
var/cost_hotspots = 0
|
|
var/cost_post_process = 0
|
|
var/cost_superconductivity = 0
|
|
var/cost_pipenets = 0
|
|
var/cost_machinery = 0
|
|
var/cost_rebuilds = 0
|
|
var/cost_equalize = 0
|
|
|
|
var/thread_wait_ticks = 0
|
|
var/cur_thread_wait_ticks = 0
|
|
|
|
var/low_pressure_turfs = 0
|
|
var/high_pressure_turfs = 0
|
|
|
|
var/num_group_turfs_processed = 0
|
|
var/num_equalize_processed = 0
|
|
|
|
var/gas_mixes_count = 0
|
|
var/gas_mixes_allocated = 0
|
|
|
|
var/list/excited_groups = list()
|
|
var/list/active_turfs = list()
|
|
var/list/hotspots = list()
|
|
var/list/networks = list()
|
|
var/list/rebuild_queue = list()
|
|
var/list/expansion_queue = list()
|
|
/// List of turfs to recalculate adjacent turfs on before processing
|
|
var/list/adjacent_rebuild = list()
|
|
var/list/pipe_init_dirs_cache = list()
|
|
var/list/obj/machinery/atmos_machinery = list()
|
|
|
|
//atmos singletons
|
|
var/list/gas_reactions = list()
|
|
|
|
//Special functions lists
|
|
var/list/turf/open/high_pressure_delta = list()
|
|
|
|
/// A cache of objects that perisists between processing runs when resumed == TRUE. Dangerous, qdel'd objects not cleared from this may cause runtimes on processing.
|
|
var/list/currentrun = list()
|
|
var/currentpart = SSAIR_PIPENETS
|
|
|
|
var/map_loading = TRUE
|
|
var/list/queued_for_activation
|
|
|
|
var/lasttick = 0
|
|
|
|
var/log_explosive_decompression = TRUE // If things get spammy, admemes can turn this off.
|
|
|
|
/// Max number of turfs equalization will grab.
|
|
var/equalize_turf_limit = 10
|
|
/// Max number of turfs to look for a space turf, and max number of turfs that will be decompressed.
|
|
var/equalize_hard_turf_limit = 2000
|
|
/// Whether equalization should be enabled at all.
|
|
var/equalize_enabled = TRUE
|
|
/// Whether turf-to-turf heat exchanging should be enabled.
|
|
var/heat_enabled = FALSE
|
|
/// Max number of times process_turfs will share in a tick.
|
|
var/share_max_steps = 3
|
|
/// Excited group processing will try to equalize groups with total pressure difference less than this amount.
|
|
var/excited_group_pressure_goal = 1
|
|
|
|
var/list/paused_z_levels //Paused z-levels will not add turfs to active
|
|
|
|
/datum/controller/subsystem/air/stat_entry(msg)
|
|
msg += "C:{"
|
|
msg += "HP:[round(cost_highpressure,1)]|"
|
|
msg += "HS:[round(cost_hotspots,1)]|"
|
|
msg += "SC:[round(cost_superconductivity,1)]|"
|
|
msg += "PN:[round(cost_pipenets,1)]|"
|
|
msg += "MC:[round(cost_machinery,1)]|"
|
|
msg += "RB:[round(cost_rebuilds,1)]|"
|
|
msg += "} "
|
|
msg += "TC:{"
|
|
msg += "AT:[round(cost_turfs,1)]|"
|
|
msg += "EG:[round(cost_groups,1)]|"
|
|
msg += "EQ:[round(cost_equalize,1)]|"
|
|
msg += "PO:[round(cost_post_process,1)]"
|
|
msg += "}"
|
|
msg += "TH:[round(thread_wait_ticks,1)]|"
|
|
msg += "HS:[hotspots.len]|"
|
|
msg += "PN:[networks.len]|"
|
|
msg += "HP:[high_pressure_delta.len]|"
|
|
msg += "HT:[high_pressure_turfs]|"
|
|
msg += "LT:[low_pressure_turfs]|"
|
|
msg += "ET:[num_equalize_processed]|"
|
|
msg += "GT:[num_group_turfs_processed]|"
|
|
msg += "GA:[gas_mixes_count]|"
|
|
msg += "MG:[gas_mixes_allocated]"
|
|
return ..()
|
|
|
|
/datum/controller/subsystem/air/get_metrics()
|
|
. = ..()
|
|
.["cost_turfs"] = cost_turfs
|
|
.["cost_groups"] = cost_groups
|
|
.["cost_highpressure"] = cost_highpressure
|
|
.["cost_hotspots"] = cost_hotspots
|
|
.["cost_post_process"] = cost_post_process
|
|
.["cost_superconductivity"] = cost_superconductivity
|
|
.["cost_pipenets"] = cost_pipenets
|
|
.["cost_machinery"] = cost_machinery
|
|
.["cost_rebuilds"] = cost_rebuilds
|
|
.["cost_equalize"] = cost_equalize
|
|
.["hotspts"] = hotspots.len
|
|
.["networks"] = networks.len
|
|
.["gas_mixes_count"] = gas_mixes_count
|
|
.["gas_mixes_allocated"] = gas_mixes_allocated
|
|
.["high_pressure_turfs"] = high_pressure_turfs
|
|
.["low_pressure_turfs"] = low_pressure_turfs
|
|
.["num_equalize_processed"] = num_equalize_processed
|
|
.["num_group_turfs_processed"] = num_group_turfs_processed
|
|
.["high_pressure_delta"] = high_pressure_delta.len
|
|
|
|
/datum/controller/subsystem/air/Initialize(timeofday)
|
|
map_loading = FALSE
|
|
setup_allturfs()
|
|
setup_atmos_machinery()
|
|
setup_pipenets()
|
|
gas_reactions = init_gas_reactions()
|
|
auxtools_update_reactions()
|
|
return SS_INIT_SUCCESS
|
|
|
|
/datum/controller/subsystem/air/proc/extools_update_ssair()
|
|
|
|
/proc/reset_all_air()
|
|
SSair.can_fire = FALSE
|
|
message_admins("Air reset begun.")
|
|
for(var/turf/open/T in world)
|
|
T.Initalize_Atmos(0)
|
|
CHECK_TICK
|
|
message_admins("Air reset done.")
|
|
SSair.can_fire = TRUE
|
|
|
|
/datum/controller/subsystem/air/proc/check_threads()
|
|
if(thread_running())
|
|
cur_thread_wait_ticks++
|
|
pause()
|
|
return FALSE
|
|
return TRUE
|
|
|
|
/datum/controller/subsystem/air/fire(resumed = 0)
|
|
var/timer = TICK_USAGE_REAL
|
|
|
|
thread_wait_ticks = MC_AVERAGE(thread_wait_ticks, cur_thread_wait_ticks)
|
|
cur_thread_wait_ticks = 0
|
|
|
|
gas_mixes_count = get_amt_gas_mixes()
|
|
gas_mixes_allocated = get_max_gas_mixes()
|
|
|
|
if(length(rebuild_queue) || length(expansion_queue))
|
|
timer = TICK_USAGE_REAL
|
|
process_rebuilds()
|
|
//This does mean that the apperent rebuild costs fluctuate very quickly, this is just the cost of having them always process, no matter what
|
|
cost_rebuilds = TICK_USAGE_REAL - timer
|
|
if(state != SS_RUNNING)
|
|
return
|
|
|
|
if(currentpart == SSAIR_PIPENETS || !resumed)
|
|
timer = TICK_USAGE_REAL
|
|
if(!resumed)
|
|
cached_cost = 0
|
|
process_pipenets(resumed)
|
|
cached_cost += TICK_USAGE_REAL - timer
|
|
if(state != SS_RUNNING)
|
|
return
|
|
cost_pipenets = MC_AVERAGE(cost_pipenets, TICK_DELTA_TO_MS(cached_cost))
|
|
resumed = 0
|
|
currentpart = SSAIR_ATMOSMACHINERY
|
|
|
|
if(currentpart == SSAIR_ATMOSMACHINERY)
|
|
timer = TICK_USAGE_REAL
|
|
if(!resumed)
|
|
cached_cost = 0
|
|
process_atmos_machinery(resumed)
|
|
cached_cost += TICK_USAGE_REAL - timer
|
|
if(state != SS_RUNNING)
|
|
return
|
|
resumed = 0
|
|
cost_machinery = MC_AVERAGE(cost_machinery, TICK_DELTA_TO_MS(cached_cost))
|
|
currentpart = SSAIR_ACTIVETURFS
|
|
|
|
if(currentpart == SSAIR_ACTIVETURFS)
|
|
timer = TICK_USAGE_REAL
|
|
process_turfs(resumed)
|
|
if(state != SS_RUNNING)
|
|
return
|
|
resumed = 0
|
|
currentpart = SSAIR_EQUALIZE
|
|
|
|
if(currentpart == SSAIR_EQUALIZE)
|
|
process_turf_equalize(resumed)
|
|
if(state != SS_RUNNING)
|
|
return
|
|
resumed = 0
|
|
currentpart = SSAIR_EXCITEDGROUPS
|
|
|
|
if(currentpart == SSAIR_EXCITEDGROUPS)
|
|
process_excited_groups(resumed)
|
|
if(state != SS_RUNNING)
|
|
return
|
|
resumed = 0
|
|
currentpart = SSAIR_FINALIZE_TURFS
|
|
|
|
if(currentpart == SSAIR_FINALIZE_TURFS)
|
|
finish_turf_processing(resumed)
|
|
if(state != SS_RUNNING)
|
|
return
|
|
resumed = 0
|
|
currentpart = SSAIR_HIGHPRESSURE
|
|
|
|
if(currentpart == SSAIR_HIGHPRESSURE)
|
|
timer = TICK_USAGE_REAL
|
|
if(!resumed)
|
|
cached_cost = 0
|
|
process_high_pressure_delta(resumed)
|
|
cached_cost += TICK_USAGE_REAL - timer
|
|
if(state != SS_RUNNING)
|
|
return
|
|
cost_highpressure = MC_AVERAGE(cost_highpressure, TICK_DELTA_TO_MS(cached_cost))
|
|
resumed = 0
|
|
currentpart = SSAIR_HOTSPOTS
|
|
|
|
if(currentpart == SSAIR_HOTSPOTS)
|
|
timer = TICK_USAGE_REAL
|
|
if(!resumed)
|
|
cached_cost = 0
|
|
process_hotspots(resumed)
|
|
cached_cost += TICK_USAGE_REAL - timer
|
|
if(state != SS_RUNNING)
|
|
return
|
|
cost_hotspots = MC_AVERAGE(cost_hotspots, TICK_DELTA_TO_MS(cached_cost))
|
|
resumed = 0
|
|
currentpart = heat_enabled ? SSAIR_TURF_CONDUCTION : SSAIR_PIPENETS
|
|
|
|
// Heat -- slow and of questionable usefulness. Off by default for this reason. Pretty cool, though.
|
|
if(currentpart == SSAIR_TURF_CONDUCTION)
|
|
timer = TICK_USAGE_REAL
|
|
if(process_turf_heat(MC_TICK_REMAINING_MS))
|
|
pause()
|
|
cost_superconductivity = MC_AVERAGE(cost_superconductivity, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
|
|
if(state != SS_RUNNING)
|
|
return
|
|
resumed = 0
|
|
currentpart = SSAIR_PIPENETS
|
|
|
|
/datum/controller/subsystem/air/proc/process_pipenets(resumed = FALSE)
|
|
if (!resumed)
|
|
src.currentrun = networks.Copy()
|
|
//cache for sanic speed (lists are references anyways)
|
|
var/list/currentrun = src.currentrun
|
|
while(currentrun.len)
|
|
var/datum/thing = currentrun[currentrun.len]
|
|
currentrun.len--
|
|
if(thing)
|
|
thing.process()
|
|
else
|
|
networks.Remove(thing)
|
|
if(MC_TICK_CHECK)
|
|
return
|
|
|
|
/datum/controller/subsystem/air/proc/add_to_rebuild_queue(obj/machinery/atmospherics/atmos_machine)
|
|
if(istype(atmos_machine, /obj/machinery/atmospherics) && !atmos_machine.rebuilding)
|
|
rebuild_queue += atmos_machine
|
|
atmos_machine.rebuilding = TRUE
|
|
|
|
/datum/controller/subsystem/air/proc/add_to_expansion(datum/pipeline/line, starting_point)
|
|
var/list/new_packet = new(SSAIR_REBUILD_QUEUE)
|
|
new_packet[SSAIR_REBUILD_PIPELINE] = line
|
|
new_packet[SSAIR_REBUILD_QUEUE] = list(starting_point)
|
|
expansion_queue += list(new_packet)
|
|
|
|
/datum/controller/subsystem/air/proc/remove_from_expansion(datum/pipeline/line)
|
|
for(var/list/packet in expansion_queue)
|
|
if(packet[SSAIR_REBUILD_PIPELINE] == line)
|
|
expansion_queue -= packet
|
|
return
|
|
|
|
/datum/controller/subsystem/air/proc/process_rebuilds()
|
|
//Yes this does mean rebuilding pipenets can freeze up the subsystem forever, but if we're in that situation something else is very wrong
|
|
var/list/currentrun = rebuild_queue
|
|
while(currentrun.len || length(expansion_queue))
|
|
while(currentrun.len && !length(expansion_queue)) //If we found anything, process that first
|
|
var/obj/machinery/atmospherics/remake = currentrun[currentrun.len]
|
|
currentrun.len--
|
|
if (!remake)
|
|
continue
|
|
remake.rebuild_pipes()
|
|
if (MC_TICK_CHECK)
|
|
return
|
|
|
|
var/list/queue = expansion_queue
|
|
while(queue.len)
|
|
var/list/pack = queue[queue.len]
|
|
//We operate directly with the pipeline like this because we can trust any rebuilds to remake it properly
|
|
var/datum/pipeline/linepipe = pack[SSAIR_REBUILD_PIPELINE]
|
|
var/list/border = pack[SSAIR_REBUILD_QUEUE]
|
|
expand_pipeline(linepipe, border)
|
|
if(state != SS_RUNNING) //expand_pipeline can fail a tick check, we shouldn't let things get too fucky here
|
|
return
|
|
|
|
linepipe.building = FALSE
|
|
queue.len--
|
|
if (MC_TICK_CHECK)
|
|
return
|
|
|
|
///Rebuilds a pipeline by expanding outwards, while yielding when sane
|
|
/datum/controller/subsystem/air/proc/expand_pipeline(datum/pipeline/net, list/border)
|
|
while(border.len)
|
|
var/obj/machinery/atmospherics/borderline = border[border.len]
|
|
border.len--
|
|
|
|
var/list/result = borderline.pipeline_expansion(net)
|
|
if(!length(result))
|
|
continue
|
|
for(var/obj/machinery/atmospherics/considered_device in result)
|
|
if(!istype(considered_device, /obj/machinery/atmospherics/pipe))
|
|
considered_device.set_pipenet(net, borderline)
|
|
net.add_machinery_member(considered_device)
|
|
continue
|
|
var/obj/machinery/atmospherics/pipe/item = considered_device
|
|
if(net.members.Find(item))
|
|
continue
|
|
if(item.parent)
|
|
var/static/pipenetwarnings = 10
|
|
if(pipenetwarnings > 0)
|
|
log_mapping("build_pipeline(): [item.type] added to a pipenet while still having one. (pipes leading to the same spot stacking in one turf) around [AREACOORD(item)].")
|
|
pipenetwarnings--
|
|
if(pipenetwarnings == 0)
|
|
log_mapping("build_pipeline(): further messages about pipenets will be suppressed")
|
|
|
|
net.members += item
|
|
border += item
|
|
|
|
net.air.set_volume(net.air.return_volume() + item.volume)
|
|
item.parent = net
|
|
|
|
if(item.air_temporary)
|
|
net.air.merge(item.air_temporary)
|
|
item.air_temporary = null
|
|
|
|
if (MC_TICK_CHECK)
|
|
return
|
|
|
|
/datum/controller/subsystem/air/proc/process_turf_heat()
|
|
|
|
/datum/controller/subsystem/air/proc/process_hotspots(resumed = FALSE)
|
|
if (!resumed)
|
|
src.currentrun = hotspots.Copy()
|
|
//cache for sanic speed (lists are references anyways)
|
|
var/list/currentrun = src.currentrun
|
|
while(currentrun.len)
|
|
var/obj/effect/hotspot/H = currentrun[currentrun.len]
|
|
currentrun.len--
|
|
if (H)
|
|
H.process()
|
|
else
|
|
hotspots -= H
|
|
if(MC_TICK_CHECK)
|
|
return
|
|
|
|
|
|
/datum/controller/subsystem/air/proc/process_high_pressure_delta(resumed = 0)
|
|
while (high_pressure_delta.len)
|
|
var/turf/open/T = high_pressure_delta[high_pressure_delta.len]
|
|
high_pressure_delta.len--
|
|
T.high_pressure_movements()
|
|
T.pressure_difference = 0
|
|
T.pressure_specific_target = null
|
|
if(MC_TICK_CHECK)
|
|
return
|
|
|
|
/datum/controller/subsystem/air/proc/process_atmos_machinery(resumed = 0)
|
|
if (!resumed)
|
|
src.currentrun = atmos_machinery.Copy()
|
|
//cache for sanic speed (lists are references anyways)
|
|
var/list/currentrun = src.currentrun
|
|
while(currentrun.len)
|
|
var/obj/machinery/M = currentrun[currentrun.len]
|
|
currentrun.len--
|
|
if(M == null)
|
|
atmos_machinery.Remove(M)
|
|
if(!M || (M.process_atmos(wait / (1 SECONDS)) == PROCESS_KILL))
|
|
stop_processing_machine(M)
|
|
if(MC_TICK_CHECK)
|
|
return
|
|
|
|
/datum/controller/subsystem/air/proc/process_turf_equalize(resumed = 0)
|
|
if(process_turf_equalize_auxtools(MC_TICK_REMAINING_MS))
|
|
pause()
|
|
|
|
/datum/controller/subsystem/air/proc/process_turfs(resumed = 0)
|
|
if(process_turfs_auxtools(MC_TICK_REMAINING_MS))
|
|
pause()
|
|
|
|
/datum/controller/subsystem/air/proc/process_excited_groups(resumed = 0)
|
|
if(process_excited_groups_auxtools(MC_TICK_REMAINING_MS))
|
|
pause()
|
|
|
|
/datum/controller/subsystem/air/proc/finish_turf_processing(resumed = 0)
|
|
if(finish_turf_processing_auxtools(MC_TICK_REMAINING_MS))
|
|
pause()
|
|
|
|
/datum/controller/subsystem/air/StartLoadingMap()
|
|
map_loading = TRUE
|
|
|
|
/datum/controller/subsystem/air/StopLoadingMap()
|
|
map_loading = FALSE
|
|
|
|
/datum/controller/subsystem/air/proc/setup_allturfs()
|
|
var/times_fired = ++src.times_fired
|
|
|
|
// Clear active turfs - faster than removing every single turf in the world
|
|
// one-by-one, and Initalize_Atmos only ever adds `src` back in.
|
|
|
|
for(var/turf/setup in ALL_TURFS())
|
|
if (setup.blocks_air)
|
|
continue
|
|
setup.Initalize_Atmos(times_fired)
|
|
CHECK_TICK
|
|
|
|
/datum/controller/subsystem/air/proc/setup_atmos_machinery()
|
|
for (var/obj/machinery/atmospherics/AM in atmos_machinery)
|
|
AM.atmos_init()
|
|
CHECK_TICK
|
|
|
|
//this can't be done with setup_atmos_machinery() because
|
|
// all atmos machinery has to initalize before the first
|
|
// pipenet can be built.
|
|
/datum/controller/subsystem/air/proc/setup_pipenets()
|
|
for (var/obj/machinery/atmospherics/AM in atmos_machinery)
|
|
var/list/targets = AM.get_rebuild_targets()
|
|
for(var/datum/pipeline/build_off as anything in targets)
|
|
build_off.build_pipeline_blocking(AM)
|
|
CHECK_TICK
|
|
|
|
/datum/controller/subsystem/air/proc/setup_template_machinery(list/atmos_machines)
|
|
var/obj/machinery/atmospherics/AM
|
|
for(var/A in 1 to atmos_machines.len)
|
|
AM = atmos_machines[A]
|
|
AM.atmos_init()
|
|
CHECK_TICK
|
|
|
|
for(var/A in 1 to atmos_machines.len)
|
|
AM = atmos_machines[A]
|
|
var/list/targets = AM.get_rebuild_targets()
|
|
for(var/datum/pipeline/build_off as anything in targets)
|
|
build_off.build_pipeline_blocking(AM)
|
|
CHECK_TICK
|
|
|
|
/datum/controller/subsystem/air/proc/get_init_dirs(type, dir)
|
|
if(!pipe_init_dirs_cache[type])
|
|
pipe_init_dirs_cache[type] = list()
|
|
|
|
if(!pipe_init_dirs_cache[type]["[dir]"])
|
|
var/obj/machinery/atmospherics/temp = new type(null, FALSE, dir)
|
|
pipe_init_dirs_cache[type]["[dir]"] = temp.get_init_directions()
|
|
qdel(temp)
|
|
|
|
return pipe_init_dirs_cache[type]["[dir]"]
|
|
|
|
/datum/controller/subsystem/air/proc/start_processing_machine(obj/machinery/machine)
|
|
if(machine.atmos_processing)
|
|
return
|
|
machine.atmos_processing = TRUE
|
|
atmos_machinery += machine
|
|
|
|
/datum/controller/subsystem/air/proc/stop_processing_machine(obj/machinery/machine)
|
|
if(!machine.atmos_processing)
|
|
return
|
|
machine.atmos_processing = FALSE
|
|
atmos_machinery -= machine
|
|
currentrun -= machine
|