From 7c6475895c9631ccff51b64475dbf216045c51ac Mon Sep 17 00:00:00 2001 From: Crazylemon Date: Mon, 28 Sep 2015 11:26:02 -0700 Subject: [PATCH 1/3] Beakers now follow a drop check before being put in the sleeper Cyborgs no longer will be able to do weird things with their nodrop beakers in the sleeper. This might need some sort of replacement for this functionality, but this seems hardly functional as it is. --- code/game/machinery/Sleeper.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index eafbb40fa19..adc4542cfd4 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -300,11 +300,11 @@ if(istype(G, /obj/item/weapon/reagent_containers/glass)) if(!beaker) beaker = G - user.drop_item() - G.loc = src - user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!") - src.updateUsrDialog() - return + if (user.drop_item()) + G.loc = src + user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!") + src.updateUsrDialog() + return else user << "\red The sleeper has a beaker already." return @@ -611,4 +611,4 @@ qdel(O) src.add_fingerprint(usr) return - return \ No newline at end of file + return From a1636b3b245e90181157aa8633e0b10d17e8f3bc Mon Sep 17 00:00:00 2001 From: Crazylemon Date: Mon, 28 Sep 2015 14:48:06 -0700 Subject: [PATCH 2/3] NODROP is now more respected A few machines, especially in medical, didn't respect NODROP. Hopefully with these changes, medical cyborgs should no longer get their beaker stuck in some sort of bizarre multipositional limbo. --- code/game/dna/dna_modifier.dm | 11 +++++++---- code/game/machinery/Sleeper.dm | 2 ++ code/game/machinery/constructable_frame.dm | 2 +- code/game/machinery/cryo.dm | 8 +++++--- code/game/machinery/iv_drip.dm | 16 +++++++++------- code/modules/reagents/Chemistry-Machinery.dm | 20 +++++++++++--------- 6 files changed, 35 insertions(+), 24 deletions(-) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index d74b2672360..9bdfa73d484 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -217,10 +217,13 @@ return beaker = item - user.drop_item() - item.loc = src - user.visible_message("[user] adds \a [item] to \the [src]!", "You add \a [item] to \the [src]!") - return + if(user.drop_item()) + item.loc = src + user.visible_message("[user] adds \a [item] to \the [src]!", "You add \a [item] to \the [src]!") + return + else + user << "\The [item] is stuck to you!" + return else if (!istype(item, /obj/item/weapon/grab)) return var/obj/item/weapon/grab/G = item diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index adc4542cfd4..a84ad07458a 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -305,6 +305,8 @@ user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!") src.updateUsrDialog() return + else + user << "\The [G] is stuck to you!" else user << "\red The sleeper has a beaker already." return diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index bb7a54daf4b..38cbb0fb4c6 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -153,7 +153,7 @@ if(istype(P, /obj/item)) var/success for(var/I in req_components) - if(istype(P, I) && (req_components[I] > 0)) + if(istype(P, I) && (req_components[I] > 0) && !(P.flags & NODROP)) success=1 playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) if(istype(P, /obj/item/stack/cable_coil)) diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index c35eaacf9f8..a12f01caf6f 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -279,9 +279,11 @@ return beaker = G - user.drop_item() - G.loc = src - user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!") + if(user.drop_item()) + G.loc = src + user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!") + else + user << "The [G] is stuck to you!" if (istype(G, /obj/item/weapon/screwdriver)) if(occupant || on) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 870018c54b3..3f1658f5fe0 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -63,12 +63,14 @@ user << "There is already a reagent container loaded!" return - user.drop_item() - W.loc = src - src.beaker = W - user << "You attach \the [W] to \the [src]." - src.update_icon() - return + if(user.drop_item()) + W.loc = src + src.beaker = W + user << "You attach \the [W] to \the [src]." + src.update_icon() + return + else + user << "\The [W] is stuck to you!" else return ..() @@ -167,4 +169,4 @@ else user << "\blue No chemicals are attached." - user << "\blue [attached ? attached : "No one"] is attached." \ No newline at end of file + user << "\blue [attached ? attached : "No one"] is attached." diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 46bb04ee636..26cd1f75ae0 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -218,15 +218,17 @@ if(istype(B, /obj/item/weapon/reagent_containers/glass) || istype(B, /obj/item/weapon/reagent_containers/food/drinks)) src.beaker = B - user.drop_item() - B.loc = src - 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. - icon_beaker.pixel_x = rand(-10,5) - overlays += icon_beaker - return + if(user.drop_item()) + B.loc = src + 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. + icon_beaker.pixel_x = rand(-10,5) + overlays += icon_beaker + return + else + user << "\The [B] is stuck to you!" /obj/machinery/chem_dispenser/attackby(var/obj/item/weapon/B as obj, var/mob/user as mob, params) ..() From 9678fe09ecc6e57d4bc478509f25a4f2c81932f2 Mon Sep 17 00:00:00 2001 From: Crazylemon Date: Tue, 29 Sep 2015 11:05:34 -0700 Subject: [PATCH 3/3] Replaced location setting with forceMove() I'm restricting this only to the machine's I'm affecting with this fix. Refactoring the rest of the code to use it would be for a different thing. --- code/game/dna/dna_modifier.dm | 2 +- code/game/machinery/Sleeper.dm | 4 ++-- code/game/machinery/cryo.dm | 2 +- code/game/machinery/iv_drip.dm | 2 +- code/modules/reagents/Chemistry-Machinery.dm | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 9bdfa73d484..cbd7772f535 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -218,7 +218,7 @@ beaker = item if(user.drop_item()) - item.loc = src + item.forceMove(src) user.visible_message("[user] adds \a [item] to \the [src]!", "You add \a [item] to \the [src]!") return else diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index a84ad07458a..582a8466e22 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -299,9 +299,9 @@ /obj/machinery/sleeper/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob, params) if(istype(G, /obj/item/weapon/reagent_containers/glass)) if(!beaker) - beaker = G if (user.drop_item()) - G.loc = src + beaker = G + G.forceMove(src) user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!") src.updateUsrDialog() return diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index a12f01caf6f..53f903121ad 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -280,7 +280,7 @@ beaker = G if(user.drop_item()) - G.loc = src + G.forceMove(src) user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!") else user << "The [G] is stuck to you!" diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 3f1658f5fe0..e3bb3d32eaa 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -64,7 +64,7 @@ return if(user.drop_item()) - W.loc = src + W.forceMove(src) src.beaker = W user << "You attach \the [W] to \the [src]." src.update_icon() diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 26cd1f75ae0..d9a16e89e76 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -219,7 +219,7 @@ 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.loc = src + B.forceMove(src) user << "You set [B] on the machine." nanomanager.update_uis(src) // update all UIs attached to src if(!icon_beaker)