Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 3ba64a6

Browse files
HFR gas byproducts now uses scaled_production instead of fuel_consumption, and now scaled alongside with gas produced from moderator, code refactor (#21493)
* gu * e * oops
1 parent f8d602e commit 3ba64a6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

code/modules/atmospherics/machinery/components/fusion/hfr_main_processes.dm

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,19 +251,20 @@
251251
var/remove_amount = round(min(fuel_list[gas_id], fuel_consumption), 0.01)
252252
internal_fusion.adjust_moles(gas_id, -remove_amount)
253253
delta_fuel_list[gas_id] -= remove_amount
254+
255+
var/add_remove_amount = round(scaled_production, 0.01) // gases on the same tier are produced at normal rate
254256
for(var/gas_id in fuel.primary_products)
255-
var/add_amount = round(fuel_consumption * 0.5, 0.01)
256-
internal_fusion.adjust_moles(gas_id, add_amount)
257-
delta_fuel_list[gas_id] += add_amount
257+
internal_fusion.adjust_moles(gas_id, add_remove_amount)
258+
delta_fuel_list[gas_id] += add_remove_amount
258259

259260
if(power_level < 1)
260261
return // can't produce any gases, don't need to continue
261262

262263
// Each recipe provides a tier list of six output gases.
263264
// Which gases are produced depend on what the fusion level is.
264265
var/list/tier = fuel.secondary_products
265-
moderator_internal.adjust_moles(tier[power_level], round(scaled_production, 0.01)) // gases on the same tier are produced at normal rate
266-
delta_mod_list[tier[power_level]] += round(scaled_production, 0.01)
266+
moderator_internal.adjust_moles(tier[power_level], add_remove_amount)
267+
delta_mod_list[tier[power_level]] += add_remove_amount
267268
if(power_level < 6)
268269
moderator_internal.adjust_moles(tier[power_level + 1], round(scaled_production * 0.5, 0.01)) // gases on the above tier are produced at reduced rate
269270
delta_mod_list[tier[power_level + 1]] += round(scaled_production * 0.5, 0.01)

0 commit comments

Comments
 (0)