Buffer fix

This commit is contained in:
Fermi
2019-10-04 03:22:53 +01:00
parent 0301683ae1
commit 10f5fc3b47
3 changed files with 13 additions and 7 deletions
@@ -746,10 +746,14 @@
total_volume = 0
for(var/reagent in cached_reagents)
var/datum/reagent/R = reagent
if(R.volume == 0)
del_reagent(R.id)
if((R.volume < 0.01) && !fermiIsReacting)
del_reagent(R.id)
else
total_volume += R.volume
if(!reagent_list)
pH = 7
return 0
/datum/reagents/proc/clear_reagents()
@@ -328,6 +328,7 @@
color = "#fbc314"
pH = 0
can_synth = TRUE
addProc = TRUE
//Consumes self on addition and shifts pH
/datum/reagent/fermi/acidic_buffer/on_new(datapH)
@@ -335,7 +336,7 @@
return ..()
data = datapH
if(LAZYLEN(holder.reagent_list) == 1)
return
return ..()
holder.pH = ((holder.pH * holder.total_volume)+(pH * (volume)))/(holder.total_volume + (volume))
var/list/seen = viewers(5, get_turf(holder))
for(var/mob/M in seen)
@@ -351,13 +352,14 @@
color = "#3853a4"
pH = 14
can_synth = TRUE
addProc = TRUE
/datum/reagent/fermi/basic_buffer/on_new(datapH)
if(holder.has_reagent("stabilizing_agent"))
return ..()
data = datapH
if(LAZYLEN(holder.reagent_list) == 1)
return
return ..()
holder.pH = ((holder.pH * holder.total_volume)+(pH * (volume)))/(holder.total_volume + (volume))
var/list/seen = viewers(5, get_turf(holder))
for(var/mob/M in seen)
@@ -434,8 +434,8 @@
OptimalTempMin = 250
OptimalTempMax = 500
ExplodeTemp = 9999 //check to see overflow doesn't happen!
OptimalpHMin = 2
OptimalpHMax = 6
OptimalpHMin = 0
OptimalpHMax = 14
ReactpHLim = 0
//CatalystFact = 0 //To do 1
CurveSharpT = 4
@@ -456,14 +456,14 @@
name = "Ethyl Ethanoate buffer"
id = "basic_buffer"
results = list("basic_buffer" = 1.5)
required_reagents = list("acidic_buffer" = 0.5, "ethanol" = 0.5, "water" = 0.5)
required_reagents = list("lye" = 0.2, "ethanol" = 0.5, "water" = 0.5, "lithium" = 0.5)
required_catalysts = list("sacid" = 1) //vagely acetic
//FermiChem vars:x
OptimalTempMin = 250
OptimalTempMax = 500
ExplodeTemp = 9999 //check to see overflow doesn't happen!
OptimalpHMin = 5
OptimalpHMax = 12
OptimalpHMin = 0
OptimalpHMax = 14
ReactpHLim = 0
//CatalystFact = 0 //To do 1
CurveSharpT = 4