From 2e0398569620dadebcb28d4ddca30440e2d93387 Mon Sep 17 00:00:00 2001 From: Fermi <> Date: Sat, 12 Oct 2019 07:55:19 +0100 Subject: [PATCH] aaaa --- code/modules/reagents/chemistry/holder.dm | 14 +++++--------- .../modules/reagents/chemistry/recipes/fermi.dm | 4 ++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 7f363575ca..356ae3c645 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -128,14 +128,12 @@ /datum/reagents/proc/remove_all(amount = 1) var/list/cached_reagents = reagent_list - if((total_volume - amount) <= 0)//Because this can result in 0, I don't want it to crash. - pH = 7 if(total_volume > 0) var/part = amount / total_volume for(var/reagent in cached_reagents) var/datum/reagent/R = reagent remove_reagent(R.id, R.volume * part, ignore_pH = TRUE) - + pH = REAGENT_NORMAL_PH update_total() handle_reactions() return amount @@ -502,9 +500,8 @@ return 0 for(var/B in cached_required_reagents) // - multiplier = min(multiplier, round((get_reagent_amount(B) / cached_required_reagents[B]), CHEMICAL_QUANTISATION_LEVEL)) - if(multiplier < 1) - return 0 + multiplier = min(multiplier, round(get_reagent_amount(B) / cached_required_reagents[B])) + for(var/B in cached_required_reagents) remove_reagent(B, (multiplier * cached_required_reagents[B]), safety = 1, ignore_pH = TRUE) @@ -771,7 +768,7 @@ del_reagent(R.id) else total_volume += R.volume - if(!reagent_list || !total_volume) + if(!total_volume) pH = REAGENT_NORMAL_PH return 0 @@ -871,7 +868,6 @@ var/new_total = cached_total + amount var/cached_temp = chem_temp var/list/cached_reagents = reagent_list - var/cached_pH = pH @@ -965,7 +961,7 @@ var/datum/reagent/R = A if (R.id == reagent) if((total_volume - amount) <= 0)//Because this can result in 0, I don't want it to crash. - pH = 7 + pH = REAGENT_NORMAL_PH //In practice this is really confusing and players feel like it randomly melts their beakers, but I'm not sure how else to handle it. We'll see how it goes and I can remove this if it confuses people. else if (!ignore_pH) //if (((pH > R.pH) && (pH <= 7)) || ((pH < R.pH) && (pH >= 7))) diff --git a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm index de56b4be68..47f71d1acf 100644 --- a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm +++ b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm @@ -28,7 +28,7 @@ return //Called when temperature is above a certain threshold, or if purity is too low. -/datum/chemical_reaction/proc/FermiExplode(datum/reagents, var/atom/my_atom, volume, temp, pH, Exploding = FALSE) +/datum/chemical_reaction/proc/FermiExplode(datum/reagents/R0, var/atom/my_atom, volume, temp, pH, Exploding = FALSE) if (Exploding == TRUE) return @@ -76,7 +76,7 @@ var/datum/effect_system/smoke_spread/chem/s = new() R.my_atom = my_atom //Give the gas a fingerprint - for (var/datum/reagent/reagent in my_atom.reagents.reagent_list) //make gas for reagents, has to be done this way, otherwise it never stops Exploding + for (var/datum/reagent/reagent in R0.reagent_list) //make gas for reagents, has to be done this way, otherwise it never stops Exploding R.add_reagent(reagent.id, reagent.volume/3) //Seems fine? I think I fixed the infinite explosion bug. if (reagent.purity < 0.6)