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
+1 -1
View File
@@ -696,7 +696,7 @@
// TODO: stomach and bloodstream organ.
if(!isSynthetic())
handle_trace_chems()
if(!(species.flags & NO_BLOOD))
if(vessel && (/decl/reagent/blood in vessel.reagent_data))
// update the trace chems in our blood vessels
var/decl/reagent/blood/B = decls_repository.get_decl(/decl/reagent/blood)
B.handle_trace_chems(vessel)
+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)