Warns for genturf failures more clearly, makes planetary cleanup better (#83809)

## About The Pull Request

Ok so like, we recently had an issue where a genturf was not being
replaced, which fucked ALL of icemoon's atmosphere.

The fix was to not use a genturf with a conditionally generating area,
but that aside. (why is it CONDITIONAL TIME GREEEEEN)

Planetary turfs should act like immutable ones when roundstart
equalizing.

In addition, we should test to ensure none leaves genturfs floating
around post roundstart to avoid this sorta issue.

---------

Co-authored-by: Afevis <ShizCalev@users.noreply.github.com>
This commit is contained in:
LemonInTheDark
2024-06-11 22:48:01 -06:00
committed by GitHub
co-authored by Afevis
parent 0db6939b8d
commit efe3f3dfef
4 changed files with 29 additions and 8 deletions
@@ -470,11 +470,19 @@
for(var/turf/open/group_member as anything in turf_list)
//Cache?
var/datum/gas_mixture/turf/mix = group_member.air
if (roundstart && istype(group_member.air, /datum/gas_mixture/immutable))
imumutable_in_group = TRUE
shared_mix.copy_from(group_member.air) //This had better be immutable young man
shared_gases = shared_mix.gases //update the cache
break
if (roundstart)
if(istype(group_member.air, /datum/gas_mixture/immutable))
imumutable_in_group = TRUE
shared_mix.copy_from(group_member.air) //This had better be immutable young man
shared_gases = shared_mix.gases //update the cache
break
// If we're planetary use THAT mix, and stop here
if(group_member.planetary_atmos)
imumutable_in_group = TRUE
var/datum/gas_mixture/planetary_mix = SSair.planetary[group_member.initial_gas_mix]
shared_mix.copy_from(planetary_mix)
shared_gases = shared_mix.gases // Cache update
break
//"borrowing" this code from merge(), I need to play with the temp portion. Lets expand it out
//temperature = (giver.temperature * giver_heat_capacity + temperature * self_heat_capacity) / combined_heat_capacity
var/capacity = mix.heat_capacity()
+1
View File
@@ -204,6 +204,7 @@
#include "organ_bodypart_shuffle.dm"
#include "organ_set_bonus.dm"
#include "organs.dm"
#include "orphaned_genturf.dm"
#include "outfit_sanity.dm"
#include "oxyloss_suffocation.dm"
#include "paintings.dm"
@@ -0,0 +1,7 @@
/// Ensures we do not leave genturfs sitting around post work
/// They serve as notice to the mapper and have no functionality, but it's good to make note of it here
/datum/unit_test/orphaned_genturf
/datum/unit_test/orphaned_genturf/Run()
for(var/turf/open/genturf/orphaned in ALL_TURFS())
TEST_FAIL("Floating genturf ([orphaned.type]) detected at ([orphaned.x], [orphaned.y], [orphaned.z]) : [orphaned.loc.type]. Why was it not replaced?")