Fixes reagent exposure on transfer. (#51801)

* Fiiiiiix

Some cleaning, fixes a proc

* Density

Adds SpaceManiac's suggestion.
This commit is contained in:
TemporalOroboros
2020-06-24 10:32:52 -04:00
committed by GitHub
parent 51dac16136
commit 2188a6722e
5 changed files with 13 additions and 16 deletions
+2 -3
View File
@@ -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()
+2 -3
View File
@@ -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])
+2 -3
View File
@@ -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])
+2 -3
View File
@@ -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)
+5 -4
View File
@@ -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()