From 29e5c1c10a649e670b87b65494a1dd39f5f3dfbd Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Thu, 5 Sep 2019 23:15:30 +0100 Subject: [PATCH 1/2] Still some residual chems kicking about..!! --- code/modules/reagents/chemistry/holder.dm | 3 +-- code/modules/reagents/chemistry/machinery/chem_master.dm | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index d1eec39f44..6ce82c0473 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -1,4 +1,4 @@ -#define CHEMICAL_QUANTISATION_LEVEL 0.0001 +#define CHEMICAL_QUANTISATION_LEVEL 0.001 /proc/build_chemical_reagent_list() //Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id @@ -745,7 +745,6 @@ del_reagent(R.id) else total_volume += R.volume - return 0 /datum/reagents/proc/clear_reagents() diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 002c54be94..077ac3f43a 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -332,7 +332,7 @@ var/vol_part = min(reagents.total_volume, 30) if(text2num(many)) amount_full = round(reagents.total_volume / 30) - vol_part = reagents.total_volume % 30 + vol_part = ((reagents.total_volume*1000) % 30000) / 1000 //% operator doesn't support decimals. var/name = stripped_input(usr, "Name:","Name your bottle!", (reagents.total_volume ? reagents.get_master_reagent_name() : " "), MAX_NAME_LEN) if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !issilicon(usr))) return From 816ae638a2d325287f7beb3068c952c4d5de14be Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Thu, 5 Sep 2019 23:19:53 +0100 Subject: [PATCH 2/2] [TO_TEST] --- code/modules/reagents/chemistry/holder.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 6ce82c0473..61273d181d 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -873,7 +873,7 @@ var/datum/reagent/R = A if (R.id == reagent) //IF MERGING //Add amount and equalize purity - R.volume += amount + R.volume += round(amount, CHEMICAL_QUANTISATION_LEVEL) R.purity = ((R.purity * R.volume) + (other_purity * amount)) /((R.volume + amount)) //This should add the purity to the product update_total() @@ -895,7 +895,7 @@ var/datum/reagent/R = new D.type(data) cached_reagents += R R.holder = src - R.volume = amount + R.volume = round(amount, CHEMICAL_QUANTISATION_LEVEL) R.purity = other_purity R.loc = get_turf(my_atom) if(data)