mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 14:39:58 +01:00
[NO GBP] Instant reactions yield reagent results again (#81334)
## About The Pull Request - Fixes #81333 Should calculate purity before we remove the reagents ## Changelog 🆑 fix: Instant reactions yield reagent results again /🆑
This commit is contained in:
@@ -310,14 +310,16 @@
|
||||
if(!multiplier)//Incase we're missing reagents - usually from on_reaction being called in an equlibrium when the results.len == 0 handler catches a misflagged reaction
|
||||
return FALSE
|
||||
|
||||
//average purity to be used in scaling the yield of products formed
|
||||
var/average_purity = get_average_purity()
|
||||
|
||||
//remove the required reagents
|
||||
for(var/datum/reagent/requirement as anything in cached_required_reagents)//this is not an object
|
||||
remove_reagent(requirement, cached_required_reagents[requirement] * multiplier)
|
||||
|
||||
//add the result reagents whose yield depend on the average purity
|
||||
var/yield
|
||||
var/average_purity = get_average_purity()
|
||||
for(var/datum/reagent/product as anything in selected_reaction.results)
|
||||
for(var/datum/reagent/product as anything in cached_results)
|
||||
yield = cached_results[product] * multiplier * average_purity
|
||||
SSblackbox.record_feedback("tally", "chemical_reaction", yield, product)
|
||||
add_reagent(product, yield, null, chem_temp, average_purity)
|
||||
|
||||
Reference in New Issue
Block a user