From a6b4f5d2aa4e60b0b4b7451a87385f42bc31feff Mon Sep 17 00:00:00 2001 From: Whitellama Date: Sun, 13 Jul 2014 23:23:26 -0700 Subject: [PATCH] Fixed issues with cans complaining twice when trying to drink unopened and with transfering fluids between closed cans --- .../reagents/reagent_containers/food/cans.dm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/code/modules/reagents/reagent_containers/food/cans.dm b/code/modules/reagents/reagent_containers/food/cans.dm index 2cc1c1ffda..884d2d8e84 100644 --- a/code/modules/reagents/reagent_containers/food/cans.dm +++ b/code/modules/reagents/reagent_containers/food/cans.dm @@ -32,7 +32,7 @@ return 1 else if( istype(M, /mob/living/carbon/human) ) if (canopened == 0) - user << " You need to open the drink!" + user << "You need to open the drink!" return else if (canopened == 1) @@ -66,6 +66,9 @@ if(!proximity) return if(istype(target, /obj/structure/reagent_dispensers)) //A dispenser. Transfer FROM it TO us. + if (canopened == 0) + user << "You need to open the drink!" + return if(!target.reagents.total_volume) user << "\red [target] is empty." @@ -77,10 +80,19 @@ var/trans = target.reagents.trans_to(src, target:amount_per_transfer_from_this) user << "\blue You fill [src] with [trans] units of the contents of [target]." - if (canopened == 0) - user << "You need to open the drink!" + else if(target.is_open_container()) //Something like a glass. Player probably wants to transfer TO it. + if (canopened == 0) + user << "You need to open the drink!" + return + + if (istype(target, /obj/item/weapon/reagent_containers/food/drinks/cans)) + var/obj/item/weapon/reagent_containers/food/drinks/cans/cantarget = target + if(cantarget.canopened == 0) + user << "You need to open the drink you want to pour into!" + return + if(!reagents.total_volume) user << "\red [src] is empty." return