Fixes some runtime spam from lazyloading/map templates (#73037)

## About The Pull Request

Ensures we don't try and rebuild loading turfs midload

Turf refs persist through destroy, so when we changeturf earlier to get
our turf reservation, we insert our space turfs into the rebuild queue,
and then end up here where we can be rebuilt randomly, midload, with
uninit'd turfs

Avoids starting atmos machine processing until init

This avoids some runtimes with null gasmixtures

There's still trouble with atmos and template loading, pipes start
processing before their pipelines exist, so we just kinda get fucked.
Need to look into this more deeply, it involves pulling this stuff off
`on_construct` and `setup_template_machinery` and throwing it in maybe
late init, which I don't really relish but will just have to do
eventually.

## Why It's Good For The Game

Reduces runtime spam
This commit is contained in:
LemonInTheDark
2023-02-01 01:46:16 -08:00
committed by GitHub
parent fc9a849bea
commit 74144f2bc9
2 changed files with 9 additions and 2 deletions
+3
View File
@@ -157,9 +157,12 @@
if((T.y+height) - 1 > world.maxy)
return
// Cache for sonic speed
var/list/to_rebuild = SSair.adjacent_rebuild
// iterate over turfs in the border and clear them from active atmos processing
for(var/turf/border_turf as anything in CORNER_BLOCK_OFFSET(T, width + 2, height + 2, -1, -1))
SSair.remove_from_active(border_turf)
to_rebuild -= border_turf
for(var/turf/sub_turf as anything in border_turf.atmos_adjacent_turfs)
sub_turf.atmos_adjacent_turfs?.Remove(border_turf)
border_turf.atmos_adjacent_turfs?.Cut()