Merge pull request #14877 from Putnam3145/optimize-processing

inelastic exports no longer uselessly multiply their price by e^0 every tick
This commit is contained in:
Lin
2021-06-22 11:49:39 -07:00
committed by GitHub
+5 -3
View File
@@ -84,17 +84,19 @@ Credit dupes that require a lot of manual work shouldn't be removed, unless they
/datum/export/New()
..()
SSprocessing.processing += src
START_PROCESSING(SSprocessing, src)
init_cost = cost
export_types = typecacheof(export_types)
exclude_types = typecacheof(exclude_types)
/datum/export/Destroy()
SSprocessing.processing -= src
STOP_PROCESSING(SSprocessing, src)
return ..()
/datum/export/process()
..()
. = ..()
if(!k_elasticity)
return PROCESS_KILL
cost *= NUM_E**(k_elasticity * (1/30))
if(cost > init_cost)
cost = init_cost