mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Fixes almost all the bugs that I should have fixed six months ago (#18323)
* Fixes scanners properly this time * Just some code cleanup * Fixes HE pipes being fast * Fixes a bug that, for once, was not my fault * Bugs both my fault and otherwise * Why didn't I just do this in the first place? * Turns out I wasn't the one who did the last one * Simplification * This was just completely incorrect * Just style, which should have been included in the last commit * Use new proc * Simplification. This is still fucked up by the way * And fixes a bug with freezers. This behavior is still fucked up though * Woah fuck I nearly missed this. Freezers no longer have the volume of an entire zone. * This should really be based on partial pressure, but that's a problem for another day * There was never a reason to remove the air since thermal energy change is scale-invariant, dummy * I THINK this is as correct as it's going to get without a rewrite * Reading this hurt me * Forgot this one, long ago * Fuck lifecode * Various stuff * Removing the air is still unnecessary * Fixes these not updating the zones, but these should really adjust thermal energy rather than absolute temperature * Fixes these to update and use pressure * This one gets special mention for breaking any existing sleeping agent in the area * Whoops. I really need to standardize this. * For fuck's sake * I was going to make it adjust the environment temperature directly but looking at the code hurt my skull * Not really deserving of its own commit but R-UST is next * Existence is pain * Fixes compile errors and a trillion runtimes The gas_mixture procs should probably never return null, but oh well * You're solving for the wrong n
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
/datum/component/ai/atmos_checker
|
||||
//Atmos effect - Yes, you can make creatures that require plasma or co2 to survive. N2O is a trace gas and handled separately, hence why it isn't here. It'd be hard to add it. Hard and me don't mix (Yes, yes make all the dick jokes you want with that.) - Errorage
|
||||
var/min_oxy = 5
|
||||
var/min_oxy = 5 / CELL_VOLUME
|
||||
var/max_oxy = 0 //Leaving something at 0 means it's off - has no maximum
|
||||
var/min_tox = 0
|
||||
var/max_tox = 1
|
||||
var/max_tox = 1 / CELL_VOLUME
|
||||
var/min_co2 = 0
|
||||
var/max_co2 = 5
|
||||
var/max_co2 = 5 / CELL_VOLUME
|
||||
var/min_n2 = 0
|
||||
var/max_n2 = 0
|
||||
var/unsuitable_damage = 2 //This damage is taken when atmos doesn't fit all the requirements above
|
||||
@@ -46,41 +46,41 @@
|
||||
SendSignal(COMSIG_ADJUST_BODYTEMP, list("temp"=((Environment.temperature - controller.getBodyTemperature()) / 5)))
|
||||
|
||||
if(min_oxy)
|
||||
if(Environment.oxygen < min_oxy)
|
||||
if(Environment.molar_density("oxygen") < min_oxy)
|
||||
atmos_suitable = 0
|
||||
oxygen_alert = 1
|
||||
else
|
||||
oxygen_alert = 0
|
||||
|
||||
if(max_oxy)
|
||||
if(Environment.oxygen > max_oxy)
|
||||
if(Environment.molar_density("oxygen") > max_oxy)
|
||||
atmos_suitable = 0
|
||||
|
||||
if(min_tox)
|
||||
if(Environment.toxins < min_tox)
|
||||
if(Environment.molar_density("toxins") < min_tox)
|
||||
atmos_suitable = 0
|
||||
|
||||
if(max_tox)
|
||||
if(Environment.toxins > max_tox)
|
||||
if(Environment.molar_density("toxins") > max_tox)
|
||||
atmos_suitable = 0
|
||||
toxins_alert = 1
|
||||
else
|
||||
toxins_alert = 0
|
||||
|
||||
if(min_n2)
|
||||
if(Environment.nitrogen < min_n2)
|
||||
if(Environment.molar_density("nitrogen") < min_n2)
|
||||
atmos_suitable = 0
|
||||
|
||||
if(max_n2)
|
||||
if(Environment.nitrogen > max_n2)
|
||||
if(Environment.molar_density("nitrogen") > max_n2)
|
||||
atmos_suitable = 0
|
||||
|
||||
if(min_co2)
|
||||
if(Environment.carbon_dioxide < min_co2)
|
||||
if(Environment.molar_density("carbon_dioxide") < min_co2)
|
||||
atmos_suitable = 0
|
||||
|
||||
if(max_co2)
|
||||
if(Environment.carbon_dioxide > max_co2)
|
||||
if(Environment.molar_density("carbon_dioxide") > max_co2)
|
||||
atmos_suitable = 0
|
||||
|
||||
//Atmos effect
|
||||
|
||||
Reference in New Issue
Block a user