Updates a buncha stuff.

This commit is contained in:
Fermi
2019-09-20 21:11:20 +01:00
parent 9cca272986
commit d12fd72ebf
8 changed files with 41 additions and 27 deletions
+6 -9
View File
@@ -90,13 +90,12 @@
var/mob/living/carbon/M = L
if(!M)
return
if(chemical_flags & REAGENT_DONOTSPLIT)
return
if(cached_purity == 1)
cached_purity = purity
else if(cached_purity < 0)
else if(purity < 0)
CRASH("Purity below 0 for chem: [id], Please let Fermis Know!")
if(chemical_flags & REAGENT_DONOTSPLIT)
return
if ((inverse_chem_val > purity) && (inverse_chem))//Turns all of a added reagent into the inverse chem
M.reagents.remove_reagent(id, amount, FALSE)
@@ -143,14 +142,12 @@
return
if(!iscarbon(M))
return
cached_purity = purity //purity SHOULD be precalculated from the add_reagent, update cache.
if (purity < 0)
CRASH("Purity below 0 for chem: [id], Please let Fermis Know!")
if(chemical_flags & REAGENT_DONOTSPLIT)
return
if(cached_purity == 1)
cached_purity = purity
else if (purity < 0)
CRASH("Purity below 0 for chem: [id], Please let Fermis Know!")
if ((inverse_chem_val > purity) && (inverse_chem)) //INVERT
M.reagents.remove_reagent(id, amount, FALSE)
M.reagents.add_reagent(inverse_chem, amount, FALSE, other_purity = 1-cached_purity)