Skip to content

Changes calculate_affecting_pressure to actually be intelligible

Rob Nelson requested to merge pull/8172/FinallyFixesThisAwfulCode into Bleeding-Edge

Created by: DrCelt

before: one medical ERT rigsuit helmet would protect you, on its own, for a 8106kpa pressure difference at any pressure after: one medical ERT rigsuit helmet would protect you, on its own, for very little pressure difference - it must be combined with a hardsuit to be effective

this also fixes that captain's armour bug because man this code was awful

calculate_affecting_pressure used to check if the helmet covered all the head, and applied all of the pressure_resistance of that helmet to the pressure - it also used to check if the exosuit covered the whole body (there is no item in the game I know that does this) but would have added the exosuit pressure_resistance value to it. In effect, this was awful.

What it does now is checks all the covered items that have the pressure_resistance value of above or equal to the pressure differential from one atmosphere, returns a value from 0 - 1 (1 being fully covered, 0 not being clothed at all), and that is applied to the affecting pressure with a power of five, meaning that if any body part is exposed, it will heavily increase the affecting pressure.

Merge request reports