diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index e0127fe9862..00ba67f3b8c 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -191,7 +191,7 @@ if(href_list["ejectBeaker"]) if(beaker) var/obj/item/weapon/reagent_containers/glass/B = beaker - B.loc = loc + B.forceMove(loc) beaker = null overlays.Cut() add_fingerprint(usr) @@ -202,25 +202,27 @@ return if(broken_requirements.len && B.type == broken_requirements[1]) - broken_requirements -= broken_requirements[1] - user << "You fix [src]." if(istype(B,/obj/item/stack)) var/obj/item/stack/S = B S.use(1) else - user.drop_item() + if(!user.drop_item()) + user << "\The [B] is stuck to you!" + return qdel(B) + broken_requirements -= broken_requirements[1] + user << "You fix [src]." return if(src.beaker) - user << "Something is already loaded into the machine." + user << "Something is already loaded into the machine." return if(istype(B, /obj/item/weapon/reagent_containers/glass) || istype(B, /obj/item/weapon/reagent_containers/food/drinks)) src.beaker = B if(user.drop_item()) B.forceMove(src) - user << "You set [B] on the machine." + user << "You set [B] on the machine." nanomanager.update_uis(src) // update all UIs attached to src if(!icon_beaker) icon_beaker = image('icons/obj/chemical.dmi', src, "disp_beaker") //randomize beaker overlay position. @@ -228,7 +230,7 @@ overlays += icon_beaker return else - user << "\The [B] is stuck to you!" + user << "The [src] can now be moved." + user << "\The [src] can now be moved." else if(!anchored) anchored = 1 - user << "The [src] is now secured." + user << "\The [src] is now secured." if(panel_open) if(istype(I, /obj/item/weapon/crowbar)) if(beaker) var/obj/item/weapon/reagent_containers/glass/B = beaker - B.loc = loc + B.forceMove(loc) beaker = null default_deconstruction_crowbar(I) return 1 @@ -427,26 +429,30 @@ if(istype(B, /obj/item/weapon/reagent_containers/glass) || istype(B, /obj/item/weapon/reagent_containers/food/drinks/drinkingglass)) if(src.beaker) - user << "A beaker is already loaded into the machine." + user << "A beaker is already loaded into the machine." return - src.beaker = B - user.drop_item() - B.loc = src - user << "You add the beaker to the machine!" - src.updateUsrDialog() - icon_state = "mixer1" + if(user.drop_item()) + src.beaker = B + B.forceMove(src) + user << "You add the beaker to the machine!" + src.updateUsrDialog() + icon_state = "mixer1" + else + user << "\The [B] is stuck to you!" else if(istype(B, /obj/item/weapon/storage/pill_bottle)) if(src.loaded_pill_bottle) - user << "A pill bottle is already loaded into the machine." + user << "A pill bottle is already loaded into the machine." return - src.loaded_pill_bottle = B - user.drop_item() - B.loc = src - user << "You add the pill bottle into the dispenser slot!" - src.updateUsrDialog() + if(user.drop_item()) + src.loaded_pill_bottle = B + B.forceMove(src) + user << "You add the pill bottle into the dispenser slot!" + src.updateUsrDialog() + else + user << "\The [B] is stuck to you!" return /obj/machinery/chem_master/Topic(href, href_list) @@ -459,7 +465,7 @@ if (href_list["ejectp"]) if(loaded_pill_bottle) - loaded_pill_bottle.loc = src.loc + loaded_pill_bottle.forceMove(src.loc) loaded_pill_bottle = null else if(href_list["close"]) usr << browse(null, "window=chem_master") @@ -579,7 +585,7 @@ reagents.trans_to(P,amount_per_pill) if(src.loaded_pill_bottle) if(loaded_pill_bottle.contents.len < loaded_pill_bottle.storage_slots) - P.loc = loaded_pill_bottle + P.forceMove(loaded_pill_bottle) src.updateUsrDialog() else var/name = reject_bad_text(input(usr,"Name:","Name your bag!",reagents.get_master_reagent_name())) @@ -816,15 +822,17 @@ if (beaker) return 1 else - src.beaker = O - user.drop_item() - O.loc = src - update_icon() - src.updateUsrDialog() - return 0 + if(user.drop_item()) + src.beaker = O + O.forceMove(src) + update_icon() + src.updateUsrDialog() + return 0 + else + user << "\The [O] is stuck to you!" if(holdingitems && holdingitems.len >= limit) - usr << "The machine cannot hold anymore items." + usr << "The machine cannot hold anymore items." return 1 //Fill machine with the plantbag! @@ -832,25 +840,25 @@ for (var/obj/item/weapon/reagent_containers/food/snacks/grown/G in O.contents) O.contents -= G - G.loc = src + G.forceMove(src) holdingitems += G if(holdingitems && holdingitems.len >= limit) //Sanity checking so the blender doesn't overfill - user << "You fill the All-In-One grinder to the brim." + user << "You empty the plant bag into the All-In-One grinder." src.updateUsrDialog() return 0 if (!is_type_in_list(O, blend_items) && !is_type_in_list(O, juice_items)) - user << "Cannot refine into a reagent." + user << "Cannot refine into a reagent." return 1 user.unEquip(O) - O.loc = src + O.forceMove(src) holdingitems += O src.updateUsrDialog() return 0 @@ -929,7 +937,7 @@ return if (!beaker) return - beaker.loc = src.loc + beaker.forceMove(src.loc) beaker = null update_icon() @@ -941,7 +949,7 @@ return for(var/obj/item/O in holdingitems) - O.loc = src.loc + O.forceMove(src.loc) holdingitems -= O holdingitems = list() @@ -1146,4 +1154,4 @@ var/amount = O.reagents.total_volume O.reagents.trans_to(beaker, amount) if(!O.reagents.total_volume) - remove_object(O) + remove_object(O) \ No newline at end of file