Trace Chems Runtime Fix (#12282)

* Trace Chems Runtime Fix

* more robust solution
This commit is contained in:
Geeves
2021-08-01 15:22:53 -03:00
committed by GitHub
parent 91878c6027
commit 334808a4fc
2 changed files with 6 additions and 5 deletions
+5 -4
View File
@@ -46,10 +46,11 @@
holder.remove_reagent(type, amount) // Don't typecheck this, fix anywhere this is called with a null holder.
if(ishuman(holder.my_atom))
var/mob/living/carbon/human/H = holder.my_atom
if(H.vessel.reagent_data[/decl/reagent/blood]["trace_chem"][type])
H.vessel.reagent_data[/decl/reagent/blood]["trace_chem"][type] += amount
else
H.vessel.reagent_data[/decl/reagent/blood]["trace_chem"][type] = amount
if(H.vessel && (/decl/reagent/blood in H.vessel.reagent_data))
if(H.vessel.reagent_data[/decl/reagent/blood]["trace_chem"][type])
H.vessel.reagent_data[/decl/reagent/blood]["trace_chem"][type] += amount
else
H.vessel.reagent_data[/decl/reagent/blood]["trace_chem"][type] = amount
// This doesn't apply to skin contact - this is for, e.g. extinguishers and sprays. The difference is that reagent is not directly on the mob's skin - it might just be on their clothing.
/decl/reagent/proc/touch_mob(var/mob/living/M, var/amount, var/datum/reagents/holder)