Refactor on_reagent_change to pass through the change type

This commit is contained in:
oranges
2017-11-25 00:45:44 +13:00
committed by CitadelStationBot
parent 9f7b3a11c3
commit c43591982a
18 changed files with 44 additions and 37 deletions
+4 -5
View File
@@ -1,5 +1,4 @@
///////////////////////////////////////////////////////////////////////////////////
/datum/reagents
@@ -428,7 +427,7 @@
reagent_list -= R
update_total()
if(my_atom)
my_atom.on_reagent_change()
my_atom.on_reagent_change(DEL_REAGENT)
check_ignoreslow(my_atom)
check_gofast(my_atom)
check_goreallyfast(my_atom)
@@ -526,7 +525,7 @@
R.volume += amount
update_total()
if(my_atom)
my_atom.on_reagent_change()
my_atom.on_reagent_change(ADD_REAGENT)
R.on_merge(data, amount)
if(!no_react)
handle_reactions()
@@ -545,7 +544,7 @@
update_total()
if(my_atom)
my_atom.on_reagent_change()
my_atom.on_reagent_change(ADD_REAGENT)
if(!no_react)
handle_reactions()
if(isliving(my_atom))
@@ -587,7 +586,7 @@
if(!safety)//So it does not handle reactions when it need not to
handle_reactions()
if(my_atom)
my_atom.on_reagent_change()
my_atom.on_reagent_change(REM_REAGENT)
return TRUE
return FALSE
@@ -13,7 +13,7 @@
reagents.add_reagent("blood", 200, list("donor"=null,"viruses"=null,"blood_DNA"=null,"blood_type"=blood_type,"resistances"=null,"trace_chem"=null))
update_icon()
/obj/item/reagent_containers/blood/on_reagent_change()
/obj/item/reagent_containers/blood/on_reagent_change(changetype)
if(reagents)
var/datum/reagent/blood/B = reagents.has_reagent("blood")
if(B && B.data && B.data["blood_type"])
@@ -15,7 +15,7 @@
icon_state = "bottle"
update_icon()
/obj/item/reagent_containers/glass/bottle/on_reagent_change()
/obj/item/reagent_containers/glass/bottle/on_reagent_change(changetype)
update_icon()
/obj/item/reagent_containers/glass/bottle/update_icon()
@@ -126,7 +126,7 @@
. = ..()
update_icon()
/obj/item/reagent_containers/glass/beaker/on_reagent_change()
/obj/item/reagent_containers/glass/beaker/on_reagent_change(changetype)
update_icon()
/obj/item/reagent_containers/glass/beaker/update_icon()
@@ -21,7 +21,7 @@
mode = SYRINGE_INJECT
update_icon()
/obj/item/reagent_containers/syringe/on_reagent_change()
/obj/item/reagent_containers/syringe/on_reagent_change(changetype)
update_icon()
/obj/item/reagent_containers/syringe/pickup(mob/user)