From 1607f64e06b6f9a4538ca420428854c130f5befa Mon Sep 17 00:00:00 2001 From: Crazylemon Date: Sat, 3 Oct 2015 11:26:23 -0700 Subject: [PATCH] Thoroughly flushes out every apparently obvious beaker drop exploit This also updates the formatting on a few devices and updates them to use forceMove() --- code/modules/food/icecream_vat.dm | 7 ++-- code/modules/reagents/dartgun.dm | 38 ++++++++++---------- code/modules/reagents/newchem/chem_heater.dm | 4 +-- code/modules/virus2/centrifuge.dm | 14 ++++---- code/modules/virus2/curer.dm | 11 +++--- code/modules/virus2/dishincubator.dm | 34 +++++++++--------- 6 files changed, 55 insertions(+), 53 deletions(-) diff --git a/code/modules/food/icecream_vat.dm b/code/modules/food/icecream_vat.dm index e71afb26482..84c231778ac 100644 --- a/code/modules/food/icecream_vat.dm +++ b/code/modules/food/icecream_vat.dm @@ -34,9 +34,10 @@ if(beaker) user << "A container is already inside [src]." return + if(!user.drop_item()) + user << "\The [I] is stuck to you!" beaker = I - user.drop_item() - I.loc = src + I.forceMove(src) user << "You add [I] to [src]" updateUsrDialog() return @@ -105,7 +106,7 @@ else if(href_list["eject"]) if(beaker) - A.loc = loc + A.forceMove(loc) beaker = null reagents.trans_to(A,reagents.total_volume) diff --git a/code/modules/reagents/dartgun.dm b/code/modules/reagents/dartgun.dm index 6affdf1f8b7..52b297d88eb 100644 --- a/code/modules/reagents/dartgun.dm +++ b/code/modules/reagents/dartgun.dm @@ -60,11 +60,11 @@ /obj/item/weapon/gun/dartgun/examine(mob/user) if(..(user, 2)) if(beakers.len) - user << "\blue [src] contains:" + user << "[R.volume] units of [R.name]" /obj/item/weapon/gun/dartgun/attackby(obj/item/I as obj, mob/user as mob, params) if(istype(I, /obj/item/weapon/dart_cartridge)) @@ -72,34 +72,36 @@ var/obj/item/weapon/dart_cartridge/D = I if(!D.darts) - user << "\blue [D] is empty." + user << "[D] is empty." return 0 if(cartridge) if(cartridge.darts <= 0) src.remove_cartridge() else - user << "\blue There's already a cartridge in [src]." + user << "There's already a cartridge in [src]." return 0 user.drop_item() cartridge = D - D.loc = src - user << "\blue You slot [D] into [src]." + D.forceMove(src) + user << "You slot [D] into [src]." update_icon() return if(istype(I, /obj/item/weapon/reagent_containers/glass)) if(!istype(I, container_type)) - user << "\blue [I] doesn't seem to fit into [src]." + user << "[I] doesn't seem to fit into [src]." return if(beakers.len >= max_beakers) - user << "\blue [src] already has [max_beakers] beakers in it - another one isn't going to fit!" + user << "[src] already has [max_beakers] beakers in it - another one isn't going to fit!" return var/obj/item/weapon/reagent_containers/glass/beaker/B = I - user.drop_item() - B.loc = src + if(!user.drop_item()) + user << "\The [B] is stuck to you!" + return + B.forceMove(src) beakers += B - user << "\blue You slot [B] into [src]." + user << "You pop the cartridge out of [src]." var/obj/item/weapon/dart_cartridge/C = cartridge - C.loc = get_turf(src) + C.forceMove(get_turf(src)) C.update_icon() cartridge = null src.update_icon() @@ -143,10 +145,10 @@ var/obj/effect/syringe_gun_dummy/D = new/obj/effect/syringe_gun_dummy(get_turf(src)) var/obj/item/weapon/reagent_containers/syringe/S = get_mixed_syringe() if(!S) - user << "\red There are no darts in [src]!" + user << "There are no darts in [src]!" return if(!S.reagents) - user << "\red There are no reagents available!" + user << "There are no reagents available!" return cartridge.darts-- src.update_icon() @@ -269,10 +271,10 @@ if(index <= beakers.len) if(beakers[index]) var/obj/item/weapon/reagent_containers/glass/beaker/B = beakers[index] - usr << "You remove [B] from [src]." + usr << "You remove [B] from [src]." mixing -= B beakers -= B - B.loc = get_turf(src) + B.forceMove(get_turf(src)) else if (href_list["eject_cart"]) remove_cartridge() src.updateUsrDialog() @@ -282,7 +284,7 @@ if(cartridge) spawn(0) fire_dart(target,user) else - usr << "\red [src] is empty." + usr << "[src] is empty." /obj/item/weapon/gun/dartgun/vox diff --git a/code/modules/reagents/newchem/chem_heater.dm b/code/modules/reagents/newchem/chem_heater.dm index be04e4d8d0a..e6e4ca61958 100644 --- a/code/modules/reagents/newchem/chem_heater.dm +++ b/code/modules/reagents/newchem/chem_heater.dm @@ -53,7 +53,7 @@ /obj/machinery/chem_heater/proc/eject_beaker() if(beaker) - beaker.loc = get_turf(src) + beaker.forceMove(get_turf(src)) beaker.reagents.handle_reactions() beaker = null icon_state = "mixer0b" @@ -79,7 +79,7 @@ if(user.drop_item()) beaker = I - I.loc = src + I.forceMove(src) user << "You add the beaker to the machine!" icon_state = "mixer1b" nanomanager.update_uis(src) diff --git a/code/modules/virus2/centrifuge.dm b/code/modules/virus2/centrifuge.dm index 9573e08ea50..1d8dc7b0611 100644 --- a/code/modules/virus2/centrifuge.dm +++ b/code/modules/virus2/centrifuge.dm @@ -18,12 +18,12 @@ user << "\The [src] is already loaded." return - sample = O - user.drop_item() - O.loc = src + if(user.drop_item()) + sample = O + O.forceMove(src) - user.visible_message("[user] adds \a [O] to \the [src]!", "You add \a [O] to \the [src]!") - nanomanager.update_uis(src) + user.visible_message("[user] adds \a [O] to \the [src]!", "You add \a [O] to \the [src]!") + nanomanager.update_uis(src) src.attack_hand(user) @@ -140,7 +140,7 @@ if("sample") if(sample) - sample.loc = src.loc + sample.forceMove(src.loc) sample = null return 1 @@ -210,4 +210,4 @@ Additional Notes: "} - state("The nearby computer prints out a pathology report.") + state("The nearby computer prints out a pathology report.") \ No newline at end of file diff --git a/code/modules/virus2/curer.dm b/code/modules/virus2/curer.dm index 054f56c8cd4..1db66e49fa4 100644 --- a/code/modules/virus2/curer.dm +++ b/code/modules/virus2/curer.dm @@ -11,14 +11,13 @@ /obj/machinery/computer/curer/attackby(var/obj/I as obj, var/mob/user as mob, params) if(istype(I,/obj/item/weapon/reagent_containers)) var/mob/living/carbon/C = user - if(!container) + if(!container && C.drop_item()) container = I - C.drop_item() - I.loc = src + I.forceMove(src) return if(istype(I,/obj/item/weapon/virusdish)) if(virusing) - user << "The pathogen materializer is still recharging.." + user << "The pathogen materializer is still recharging.." return var/obj/item/weapon/reagent_containers/glass/beaker/product = new(src.loc) @@ -88,7 +87,7 @@ if (href_list["antibody"]) curing = 10 else if(href_list["eject"]) - container.loc = src.loc + container.forceMove(src.loc) container = null src.add_fingerprint(usr) @@ -105,4 +104,4 @@ data["antibodies"] = B.data["antibodies"] product.reagents.add_reagent("antibodies",30,data) - state("\The [src.name] buzzes", "blue") + state("\The [src.name] buzzes", "blue") \ No newline at end of file diff --git a/code/modules/virus2/dishincubator.dm b/code/modules/virus2/dishincubator.dm index cc79387c7e6..5b1e0396fe7 100644 --- a/code/modules/virus2/dishincubator.dm +++ b/code/modules/virus2/dishincubator.dm @@ -18,18 +18,18 @@ if(istype(O, /obj/item/weapon/reagent_containers/glass) || istype(O,/obj/item/weapon/reagent_containers/syringe)) if(beaker) - user << "\The [src] is already loaded." + user << "