diff --git a/code/__HELPERS/reagents.dm b/code/__HELPERS/reagents.dm index fa655efce4..0ecf82b191 100644 --- a/code/__HELPERS/reagents.dm +++ b/code/__HELPERS/reagents.dm @@ -101,3 +101,9 @@ return GLOB.chemical_reagents_list[input] else return null + +//Checks for if the given reagent R is invalid to process for its passed owner. +/proc/is_reagent_processing_invalid(datum/reagent/R, mob/living/owner) + if(!R || !owner) + return TRUE + return ((HAS_TRAIT(owner, TRAIT_ROBOTIC_ORGANISM) && !(R.chemical_flags & REAGENT_ROBOTIC_PROCESS)) || (!HAS_TRAIT(owner, TRAIT_ROBOTIC_ORGANISM) && !(R.chemical_flags & REAGENT_ORGANIC_PROCESS))) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 0bf7b13646..3ded0310dd 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -467,7 +467,8 @@ GENETICS SCANNER if(length(reagents)) msg += "Subject contains the following reagents:\n" for(var/datum/reagent/R in reagents) - msg += "[R.volume] units of [R.name][R.overdosed == 1 ? " - OVERDOSING" : "."]\n" + var/invalid_reagent = is_reagent_processing_invalid(R, M) + msg += "[invalid_reagent ? "" : ""][R.volume] units of [R.name][invalid_reagent ? "" : ""][R.overdosed == 1 ? " - OVERDOSING" : "."]\n" else msg += "Subject contains no reagents.\n" diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 278aeebb22..196c5ff654 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -39,7 +39,7 @@ //Procs called while dead /mob/living/carbon/proc/handle_death() for(var/datum/reagent/R in reagents.reagent_list) - if(R.chemical_flags & REAGENT_DEAD_PROCESS && ((HAS_TRAIT(src, TRAIT_ROBOTIC_ORGANISM) && (R.chemical_flags & REAGENT_ROBOTIC_PROCESS)) || (!HAS_TRAIT(src, TRAIT_ROBOTIC_ORGANISM) && (R.chemical_flags & REAGENT_ORGANIC_PROCESS)))) + if(R.chemical_flags & REAGENT_DEAD_PROCESS && !is_reagent_processing_invalid(R, src)) R.on_mob_dead(src) /////////////// diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 3d5514544e..7c563b3cb1 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -345,7 +345,7 @@ if(owner && reagent) if(!owner.reagent_check(reagent, delta_time, times_fired) != TRUE) return - if((HAS_TRAIT(owner, TRAIT_ROBOTIC_ORGANISM) && !(reagent.chemical_flags & REAGENT_ROBOTIC_PROCESS)) || (!HAS_TRAIT(owner, TRAIT_ROBOTIC_ORGANISM) && !(reagent.chemical_flags & REAGENT_ORGANIC_PROCESS))) + if(is_reagent_processing_invalid(reagent, owner)) return reagent.on_invalid_process(owner, delta_time, times_fired) if(liverless && !reagent.self_consuming) //need to be metabolized return