Commit Graph

3 Commits

Author SHA1 Message Date
SkyratBot c5ca08fd01 [MIRROR] Adds spaces around logical operators [MDB IGNORE] (#18776)
* Adds spaces around logical operators

* Update code/modules/admin/verbs/admingame.dm

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
2023-01-21 22:16:43 -08:00
SkyratBot 7e6bef4a90 [NO GBP] Loosens gas pressure transfer calculation limit a bit. (#66553) (#13363)
I initially kept it an exclusive check so funny things like division by inf doesnt get in, but I implemented more inf checks on the quadratic proc and the likes so it really shouldnt be necessary now. This should hopefully reduce cases when the target pressure hits the upper limit because the target gasmix has a miniscule amount of moles, having the result be rejected by the code, and triggering a runtime.

And some minor improvements to the code so it doesnt iterate through the gaslist multiple times.
Nicer code

Co-authored-by: vincentiusvin <54709710+vincentiusvin@users.noreply.github.com>
2022-05-06 12:49:16 +01:00
SkyratBot 640559580e [MIRROR] Pump pressure calculation now respects temperature. [MDB IGNORE] (#10812)
* Pump pressure calculation now respects temperature. (#62320)

Ever pump hot nob into a tank of oxygen, see the pressure rise to 8000 kpa for a few seconds and have that deafening explosion sound play right after? This attempts to eliminate those by making the pressure transfer proc thingy in gas_mixture account for resulting temperature. The old one is preserved if the temperature difference isn't too big because it's most definitely more performant. The minimum temperature difference of 5 is completely arbitrary and I won't mind changing if asked. Math is a bit messy by necessity but I hope the comment is adequate.

While I'm at it i also changed the return value of those procs to return a removed gasmix instead of directly merging. I sort of needed this for a clean implementation of assume_air in #62284. Will need more testing though. Found a better solution.

Writes a small unit test to check for this too.

Cuts down on one unintended cause of explosions.

* Pump pressure calculation now respects temperature.

Co-authored-by: vincentiusvin <54709710+vincentiusvin@users.noreply.github.com>
2022-01-19 01:26:55 +00:00