From f85aaa7bbdf4a8cd8fde4ce2146eb730a73743e5 Mon Sep 17 00:00:00 2001 From: Pickle-Coding <58013024+Pickle-Coding@users.noreply.github.com> Date: Wed, 2 Nov 2022 00:32:59 +0000 Subject: [PATCH] [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. --- code/modules/power/supermatter/supermatter.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 4ad416ed6e8..f28e86b80c1 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -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)