diff --git a/code/modules/plumbing/plumbers/plumbing_buffer.dm b/code/modules/plumbing/plumbers/plumbing_buffer.dm index b2bb21bc24e..7b3ef306d04 100644 --- a/code/modules/plumbing/plumbers/plumbing_buffer.dm +++ b/code/modules/plumbing/plumbers/plumbing_buffer.dm @@ -33,11 +33,11 @@ SIGNAL_HANDLER if(!buffer_net) return - if(reagents.total_volume + CHEMICAL_QUANTISATION_LEVEL >= activation_volume && mode == UNREADY) + if(reagents.total_volume >= activation_volume && mode == UNREADY) mode = IDLE buffer_net.check_active() - else if(reagents.total_volume + CHEMICAL_QUANTISATION_LEVEL < activation_volume && mode != UNREADY) + else if(reagents.total_volume < activation_volume && mode != UNREADY) mode = UNREADY buffer_net.check_active() diff --git a/code/modules/plumbing/plumbers/reaction_chamber.dm b/code/modules/plumbing/plumbers/reaction_chamber.dm index 965b428acbd..2b56bfb4ae6 100644 --- a/code/modules/plumbing/plumbers/reaction_chamber.dm +++ b/code/modules/plumbing/plumbers/reaction_chamber.dm @@ -43,7 +43,7 @@ /obj/machinery/plumbing/reaction_chamber/proc/on_reagent_change(datum/reagents/holder, ...) SIGNAL_HANDLER - if(holder.total_volume <= CHEMICAL_VOLUME_ROUNDING && emptying) //we were emptying, but now we aren't + if(!holder.total_volume && emptying) //we were emptying, but now we aren't emptying = FALSE holder.flags |= NO_REACT return NONE diff --git a/code/modules/reagents/chemistry/holder/holder.dm b/code/modules/reagents/chemistry/holder/holder.dm index 112c9fca8a1..867245e9c25 100644 --- a/code/modules/reagents/chemistry/holder/holder.dm +++ b/code/modules/reagents/chemistry/holder/holder.dm @@ -129,7 +129,6 @@ amount = adjusted_vol has_split = TRUE - update_total() var/cached_total = total_volume if(cached_total + amount > maximum_volume) amount = maximum_volume - cached_total //Doesnt fit in. Make it disappear. shouldn't happen. Will happen. @@ -195,7 +194,7 @@ set_temperature(reagtemp) SEND_SIGNAL(src, COMSIG_REAGENTS_NEW_REAGENT, new_reagent, amount, reagtemp, data, no_react) - if(!no_react) + if(!no_react && !is_reacting) handle_reactions() return amount diff --git a/code/modules/reagents/chemistry/holder/reactions.dm b/code/modules/reagents/chemistry/holder/reactions.dm index 30148802e08..d7f959abbb1 100644 --- a/code/modules/reagents/chemistry/holder/reactions.dm +++ b/code/modules/reagents/chemistry/holder/reactions.dm @@ -190,7 +190,6 @@ if(!LAZYLEN(reaction_list)) finish_reacting() else - update_total() handle_reactions() /* diff --git a/code/modules/reagents/chemistry/recipes.dm b/code/modules/reagents/chemistry/recipes.dm index 579dcb52370..26fb0f472dd 100644 --- a/code/modules/reagents/chemistry/recipes.dm +++ b/code/modules/reagents/chemistry/recipes.dm @@ -182,7 +182,8 @@ var/datum/reagent/reagent = holder.has_reagent(id) if(!reagent) return - reagent.volume = round((reagent.volume * 0.98), CHEMICAL_QUANTISATION_LEVEL) //Slowly lower yield per tick + reagent.volume *= 0.98 //Slowly lower yield per tick + holder.update_total() /** * Occurs when a reation is too impure (i.e. it's below purity_min) diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm index f1fb70faf38..78942431bb8 100644 --- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm +++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm @@ -15,7 +15,7 @@ /datum/chemical_reaction/reagent_explosion/nitroglycerin/on_reaction(datum/reagents/holder, datum/equilibrium/reaction, created_volume) - if(holder.has_reagent(/datum/reagent/exotic_stabilizer,round(created_volume / 25, CHEMICAL_QUANTISATION_LEVEL))) + if(holder.has_reagent(/datum/reagent/exotic_stabilizer, created_volume / 25)) return holder.remove_reagent(/datum/reagent/nitroglycerin, created_volume * 2) ..() @@ -78,10 +78,10 @@ strengthdiv = 3 /datum/chemical_reaction/reagent_explosion/tatp/update_info() - required_temp = 450 + rand(-49,49) //this gets loaded only on round start + required_temp = 450 + rand(-49, 49) //this gets loaded only on round start /datum/chemical_reaction/reagent_explosion/tatp/on_reaction(datum/reagents/holder, datum/equilibrium/reaction, created_volume) - if(holder.has_reagent(/datum/reagent/exotic_stabilizer,round(created_volume / 50, CHEMICAL_QUANTISATION_LEVEL))) // we like exotic stabilizer + if(holder.has_reagent(/datum/reagent/exotic_stabilizer, created_volume / 50)) // we like exotic stabilizer return holder.remove_reagent(/datum/reagent/tatp, created_volume) ..() diff --git a/code/modules/surgery/organs/internal/liver/_liver.dm b/code/modules/surgery/organs/internal/liver/_liver.dm index 92e2cb0039f..33dcaa83fd1 100755 --- a/code/modules/surgery/organs/internal/liver/_liver.dm +++ b/code/modules/surgery/organs/internal/liver/_liver.dm @@ -142,7 +142,7 @@ for(var/datum/reagent/toxin/toxin in cached_reagents) if(toxin.affected_organ_flags && !(organ_flags & toxin.affected_organ_flags)) //this particular toxin does not affect this type of organ continue - var/amount = round(toxin.volume, CHEMICAL_QUANTISATION_LEVEL) // this is an optimization + var/amount = toxin.volume if(belly) amount += belly.reagents.get_reagent_amount(toxin.type)