Fixes newfood reagent transfer and food trash' to_chat (#55150)

Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
This commit is contained in:
Qustinnus
2020-12-02 02:04:58 -08:00
committed by GitHub
co-authored by Jared-Fogle
parent 126df37863
commit 9c85aba400
3 changed files with 19 additions and 17 deletions
+16
View File
@@ -324,6 +324,22 @@
src.handle_reactions()
return amount
///Multiplies the reagents inside this holder by a specific amount
/datum/reagents/proc/multiply_reagents(multiplier=1)
var/list/cached_reagents = reagent_list
if(!total_volume)
return
var/change = (multiplier - 1) //Get the % change
for(var/reagent in cached_reagents)
var/datum/reagent/T = reagent
if(change > 0)
add_reagent(T.type, T.volume * change)
else
remove_reagent(T.type, abs(T.volume * change)) //absolute value to prevent a double negative situation (removing -50% would be adding 50%)
update_total()
handle_reactions()
/// Transfer a specific reagent id to the target object
/datum/reagents/proc/trans_id_to(obj/target, reagent, amount=1, preserve_data=1)//Not sure why this proc didn't exist before. It does now! /N
var/list/cached_reagents = reagent_list