[WEBEDIT INCOMING] Fixes supermatter powerloss threshold check. (#70817)

Replaces the internal_energy is below powerloss_linear_threshold check with a momentary_power is below powerloss_linear_threshold check.

Fixes supermatter powerloss threshold check to check for the momentary power instead of internal energy.

The powerloss math is based on the momentary power, but the if check checked for the internal_energy instead, which made it continue using cubic power loss at inappropriate situations.
This commit is contained in:
Pickle-Coding
2022-11-02 00:32:59 +00:00
committed by GitHub
parent b50730c89d
commit f85aaa7bbd
@@ -571,7 +571,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
var/momentary_power = internal_energy
for(var/powergain_type in additive_power)
momentary_power += additive_power[powergain_type]
if(internal_energy < powerloss_linear_threshold) // Negative numbers
if(momentary_power < powerloss_linear_threshold) // Negative numbers
additive_power[SM_POWER_POWERLOSS] = -1 * (momentary_power / POWERLOSS_CUBIC_DIVISOR) ** 3
else
additive_power[SM_POWER_POWERLOSS] = -1 * (momentary_power * POWERLOSS_LINEAR_RATE + powerloss_linear_offset)