From 728be9f1be01d3fb1bdd2e5fdc2d7d3eeebb4b6a Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 2 Nov 2022 18:41:19 +0100 Subject: [PATCH] [MIRROR] [WEBEDIT INCOMING] Fixes supermatter powerloss threshold check. [MDB IGNORE] (#17309) * [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. * [WEBEDIT INCOMING] Fixes supermatter powerloss threshold check. Co-authored-by: Pickle-Coding <58013024+Pickle-Coding@users.noreply.github.com> --- 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)