From 2188a6722e7627baf0093e7664eca022e9ea2330 Mon Sep 17 00:00:00 2001 From: TemporalOroboros Date: Wed, 24 Jun 2020 07:32:52 -0700 Subject: [PATCH] Fixes reagent exposure on transfer. (#51801) * Fiiiiiix Some cleaning, fixes a proc * Density Adds SpaceManiac's suggestion. --- code/game/atoms.dm | 5 ++--- code/game/objects/objs.dm | 5 ++--- code/game/turfs/turf.dm | 5 ++--- code/modules/mob/living/living_defense.dm | 5 ++--- code/modules/reagents/chemistry/holder.dm | 9 +++++---- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 23672cbaa70..f5149b53796 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -449,13 +449,12 @@ * - show_message: Whether to display anything to mobs when they are exposed. */ /atom/proc/expose_reagents(list/reagents, datum/reagents/source, method=TOUCH, volume_modifier=1, show_message=TRUE) - . = SEND_SIGNAL(src, COMSIG_ATOM_EXPOSE_REAGENTS, reagents, source, method, volume_modifier, show_message) - if(. & COMPONENT_NO_EXPOSE_REAGENTS) + if((. = SEND_SIGNAL(src, COMSIG_ATOM_EXPOSE_REAGENTS, reagents, source, method, volume_modifier, show_message)) & COMPONENT_NO_EXPOSE_REAGENTS) return for(var/reagent in reagents) var/datum/reagent/R = reagent - . |= R.expose_atom(src, reagents[R] || (R.volume * volume_modifier)) + . |= R.expose_atom(src, reagents[R]) /// Are you allowed to drop this atom /atom/proc/AllowDrop() diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 51977a5e471..7eea1a73a63 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -346,10 +346,9 @@ /// Handles exposing an object to reagents. /obj/expose_reagents(list/reagents, datum/reagents/source, method=TOUCH, volume_modifier=1, show_message=TRUE) - . = ..() - if(. & COMPONENT_NO_EXPOSE_REAGENTS) + if((. = ..()) & COMPONENT_NO_EXPOSE_REAGENTS) return for(var/reagent in reagents) var/datum/reagent/R = reagent - R.expose_obj(src, reagents[R] || (R.volume * volume_modifier)) + . |= R.expose_obj(src, reagents[R]) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index ad99021f718..30ca4c4604e 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -549,10 +549,9 @@ GLOBAL_LIST_EMPTY(station_turfs) /// Handles exposing a turf to reagents. /turf/expose_reagents(list/reagents, datum/reagents/source, method=TOUCH, volume_modifier=1, show_message=TRUE) - . = ..() - if(. & COMPONENT_NO_EXPOSE_REAGENTS) + if((. = ..()) & COMPONENT_NO_EXPOSE_REAGENTS) return for(var/reagent in reagents) var/datum/reagent/R = reagent - . |= R.expose_turf(src, reagents[R] || (R.volume * volume_modifier)) + . |= R.expose_turf(src, reagents[R]) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index e49fa57cae4..6f292a9833e 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -441,8 +441,7 @@ * If the method is VAPOR it incorporates permiability protection. */ /mob/living/expose_reagents(list/reagents, datum/reagents/source, method=TOUCH, volume_modifier=1, show_message=TRUE) - . = ..() - if(. & COMPONENT_NO_EXPOSE_REAGENTS) + if((. = ..()) & COMPONENT_NO_EXPOSE_REAGENTS) return if(method == INGEST) @@ -451,4 +450,4 @@ var/touch_protection = (method == VAPOR) ? get_permeability_protection() : 0 for(var/reagent in reagents) var/datum/reagent/R = reagent - . |= R.expose_mob(src, method, reagents[R] || (R.volume * volume_modifier), show_message, touch_protection) + . |= R.expose_mob(src, method, reagents[R], show_message, touch_protection) diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index e3eb513cf62..c5fc0a625d7 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -664,12 +664,13 @@ if(isnull(A)) return null - if(!istype(R)) + if(ispath(R)) R = get_reagent(R) - if(isnull(R)) - return null + if(isnull(R)) + return null - return A.expose_reagents(list(R = R.volume * volume_modifier), src, method, volume_modifier, show_message) + // Yes, we need the parentheses. + return A.expose_reagents(list((R) = R.volume * volume_modifier), src, method, volume_modifier, show_message) /// Is this holder full or not /datum/reagents/proc/holder_full()