From 0551f8b7e22413754d328707bbd45e3dd1a0afb9 Mon Sep 17 00:00:00 2001 From: supersayu Date: Wed, 17 Jul 2013 14:53:28 -0400 Subject: [PATCH 1/7] Fixes afterattack() bug with food/snacks. Fixes issue #678, #972. --- .../reagents/reagent_containers/food/snacks.dm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/reagents/reagent_containers/food/snacks.dm index 627b7f26358..d5c1cc9eb22 100644 --- a/code/modules/reagents/reagent_containers/food/snacks.dm +++ b/code/modules/reagents/reagent_containers/food/snacks.dm @@ -122,10 +122,9 @@ /obj/item/weapon/reagent_containers/food/snacks/attackby(obj/item/weapon/W, mob/user) if(istype(W,/obj/item/weapon/storage)) ..() // -> item/attackby() - if(istype(W,/obj/item/weapon/storage)) - ..() // -> item/attackby() + return 0 if((slices_num <= 0 || !slices_num) || !slice_path) - return 1 + return 0 var/inaccurate = 0 if( \ istype(W, /obj/item/weapon/kitchenknife) || \ @@ -143,7 +142,7 @@ inaccurate = 1 else if(W.w_class <= 2 && istype(src,/obj/item/weapon/reagent_containers/food/snacks/sliceable)) if(!iscarbon(user)) - return 1 + return 0 user << "You slip [W] inside [src]." user.u_equip(W) if ((user.client && user.s_active != src)) @@ -151,9 +150,10 @@ W.dropped(user) add_fingerprint(user) contents += W - return + return 1 // no afterattack here else - return 1 + return 0 // --- this is everything that is NOT a slicing implement, and which is not being slipped into food; allow afterattack --- + if ( \ !isturf(src.loc) || \ !(locate(/obj/structure/table) in src.loc) && \ @@ -162,6 +162,7 @@ ) user << "You cannot slice [src] here! You need a table or at least a tray." return 1 + var/slices_lost = 0 if (!inaccurate) user.visible_message( \ @@ -178,7 +179,7 @@ for(var/i=1 to (slices_num-slices_lost)) var/obj/slice = new slice_path (src.loc) reagents.trans_to(slice,reagents_per_slice) - del(src) + del(src) // so long and thanks for all the fish /obj/item/weapon/reagent_containers/food/snacks/Del() From 3ac2af0e0685f0176a96d11eb6f111d3bf57cc01 Mon Sep 17 00:00:00 2001 From: supersayu Date: Wed, 17 Jul 2013 14:54:34 -0400 Subject: [PATCH 2/7] Fixes exploit for passing plastic flaps with a locker. Fixes issue #254 --- code/game/objects/structures/crates_lockers/closets.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 7b6042ae299..d03ab1a6d8d 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -218,7 +218,7 @@ return 0 if(!isturf(O.loc)) return 0 - if(user.restrained() || user.stat || user.weakened || user.stunned || user.paralysis) + if(user.restrained() || user.stat || user.weakened || user.stunned || user.paralysis || user.lying) return 0 if((!( istype(O, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1)) return 0 From 6ca455b2a3be100af7013423c099f3ec4fffb525 Mon Sep 17 00:00:00 2001 From: supersayu Date: Wed, 17 Jul 2013 14:55:59 -0400 Subject: [PATCH 3/7] Fixes teleporter typo. Allows locking on to tracking implants. --- code/game/machinery/teleporter.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 32e37245ce1..4c61a95ea25 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -84,7 +84,7 @@ if (M.timeofdeath + 6000 < world.time) continue var/turf/T = get_turf(M) - if(T) continue + if(!T) continue if(T.z == 2) continue var/tmpname = M.real_name if(areaindex[tmpname]) @@ -368,4 +368,4 @@ if(com) com.icon_state = "tele0" else - icon_state = "controller" + icon_state = "controller" From 528dd9c31a114e8e50ca20cb7d3424fe6273d2b0 Mon Sep 17 00:00:00 2001 From: supersayu Date: Wed, 17 Jul 2013 15:07:57 -0400 Subject: [PATCH 4/7] Grab fixes and scythe tweaks Fixes the grab timer; there will now be a delay between grab upgrades. Fixes grab process so you no longer have to spam click before it disables itself. Fixes issue #577 Fixes issue #253: Prevents grab and throw when the affected mob is buckled. Prevents tabling a mob when that mob is buckled. Prevents you from dropping scythes on a table or rack if there is a space vine in that square; it will now auto-attack the vine instead. Also auto-attacks vines if you click the floor under them. --- code/game/objects/structures/tables_racks.dm | 32 +++++++++++++++++++- code/game/turfs/simulated/floor.dm | 7 ++++- code/modules/mob/mob_grab.dm | 5 ++- 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 5adf36e57e9..e95addd3d4a 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -284,6 +284,9 @@ /obj/structure/table/attackby(obj/item/weapon/W, mob/user) if (istype(W, /obj/item/weapon/grab) && get_dist(src, user) < 2) var/obj/item/weapon/grab/G = W + if(G.affecting.buckled) + user << "[G.affecting] is buckled to [G.affecting.buckled]!" + return if(G.state < GRAB_AGGRESSIVE) user << "You need a better grip to do that!" return @@ -306,6 +309,11 @@ del(src) return + var/obj/effect/spacevine/vine = locate() in loc + if(vine) // don't drop things on tables when trying to attack spacevines + vine.attackby(W,user) + return + if(isrobot(user)) return @@ -322,7 +330,6 @@ return user.drop_item(src) - //if(W && W.loc) W.loc = src.loc // Unnecessary - see: mob/proc/drop_item(atom) - Doohl return @@ -339,6 +346,9 @@ if (istype(W, /obj/item/weapon/grab)) var/obj/item/weapon/grab/G = W + if(G.affecting.buckled) + user << "[G.affecting] is buckled to [G.affecting.buckled]!" + return if(G.state < GRAB_AGGRESSIVE) user << "You need a better grip to do that!" return @@ -357,6 +367,12 @@ playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) del(src) return + + var/obj/effect/spacevine/vine = locate() in loc + if(vine) // don't drop things on tables when trying to attack spacevines + vine.attackby(W,user) + return + if(isrobot(user)) return if(istype(W, /obj/item/weapon/melee/energy/blade)) @@ -390,6 +406,9 @@ if (istype(W, /obj/item/weapon/grab)) var/obj/item/weapon/grab/G = W + if(G.affecting.buckled) + user << "[G.affecting] is buckled to [G.affecting.buckled]!" + return if(G.state < GRAB_AGGRESSIVE) user << "You need a better grip to do that!" return @@ -401,6 +420,11 @@ del(W) return + var/obj/effect/spacevine/vine = locate() in loc + if(vine) // don't drop things on tables when trying to attack spacevines + vine.attackby(W,user) + return + if (istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W if(WT.remove_fuel(0, user)) @@ -514,6 +538,12 @@ playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) del(src) return + + var/obj/effect/spacevine/vine = locate() in loc + if(vine) // don't drop things on racks when trying to attack spacevines + vine.attackby(W,user) + return + if(isrobot(user)) return user.drop_item() diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 275d35e4da1..12cfc6cff89 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -530,4 +530,9 @@ turf/simulated/floor/proc/update_icon() burnt = 0 broken = 0 else - user << "\blue You need more welding fuel to complete this task." \ No newline at end of file + user << "\blue You need more welding fuel to complete this task." + if(istype(C,/obj/item/weapon/scythe)) + var/obj/effect/spacevine/vine = locate() in src + if(vine) + vine.attackby(C,user) + return \ No newline at end of file diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index 14ec3a49e10..1d51a302f34 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -36,6 +36,8 @@ //Used by throw code to hand over the mob, instead of throwing the grab. The grab is then deleted by the throw code. /obj/item/weapon/grab/proc/throw() if(affecting) + if(affecting.buckled) + return null if(state >= GRAB_AGGRESSIVE) return affecting return null @@ -78,6 +80,7 @@ affecting.drop_item() affecting.hand = h for(var/obj/item/weapon/grab/G in affecting.grabbed_by) + if(G == src) continue if(G.state == GRAB_AGGRESSIVE) allow_upgrade = 0 if(allow_upgrade) @@ -106,7 +109,7 @@ return if(assailant.next_move > world.time) return - if(last_upgrade > world.time + UPGRADE_COOLDOWN) + if(world.time < (last_upgrade + UPGRADE_COOLDOWN)) return if(!assailant.canmove || assailant.lying) del(src) From b7c13761ef50474a278d0d545946d31b1bfb96c6 Mon Sep 17 00:00:00 2001 From: supersayu Date: Wed, 17 Jul 2013 15:51:19 -0400 Subject: [PATCH 5/7] Fixes a rare potential runtime for using the admin grant_full_access verb on a mob with something other than an ID in the ID slot. --- code/modules/admin/verbs/debug.dm | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index f3319758eff..5b93250e1c9 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -445,8 +445,33 @@ var/global/list/g_fancy_list_of_safe_types = null if(istype(H.wear_id, /obj/item/device/pda)) var/obj/item/device/pda/pda = H.wear_id id = pda.id - id.icon_state = "gold" - id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() + if(!id) + pda.id = new /obj/item/weapon/card/id(pda) + pda.id.icon_state = "gold" + pda.id.access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() + pda.id.registered_name = H.real_name + pda.id.assignment = "Captain" + pda.id.name = "[pda.id.registered_name]'s ID Card ([pda.id.assignment])" + else + id.icon_state = "gold" + id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() + else if(istype(H.wear_id,/obj/item/weapon/storage/wallet)) + var/obj/item/weapon/storage/wallet/W = H.wear_id + id = W.front_id + if(!id) + id = new /obj/item/weapon/card/id(W) + id.icon_state = "gold" + id.access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() + id.registered_name = H.real_name + id.assignment = "Captain" + id.name = "[id.registered_name]'s ID Card ([id.assignment])" + W.front_id = id + else + id.icon_state = "gold" + id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() + else + id.icon_state = "gold" + id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() else var/obj/item/weapon/card/id/id = new/obj/item/weapon/card/id(M); id.icon_state = "gold" From 78f5f96fa5b4780dcd475f77783219f54af23c03 Mon Sep 17 00:00:00 2001 From: supersayu Date: Thu, 18 Jul 2013 23:02:54 -0400 Subject: [PATCH 6/7] Fix for the grant_full_access that doesn't suck --- code/modules/admin/verbs/debug.dm | 57 +++++++++++-------------------- 1 file changed, 20 insertions(+), 37 deletions(-) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 5b93250e1c9..6cc3438fba4 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -440,47 +440,30 @@ var/global/list/g_fancy_list_of_safe_types = null return if (istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M - if (H.wear_id) - var/obj/item/weapon/card/id/id = H.wear_id - if(istype(H.wear_id, /obj/item/device/pda)) - var/obj/item/device/pda/pda = H.wear_id - id = pda.id - if(!id) - pda.id = new /obj/item/weapon/card/id(pda) - pda.id.icon_state = "gold" - pda.id.access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() - pda.id.registered_name = H.real_name - pda.id.assignment = "Captain" - pda.id.name = "[pda.id.registered_name]'s ID Card ([pda.id.assignment])" - else - id.icon_state = "gold" - id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() - else if(istype(H.wear_id,/obj/item/weapon/storage/wallet)) - var/obj/item/weapon/storage/wallet/W = H.wear_id - id = W.front_id - if(!id) - id = new /obj/item/weapon/card/id(W) - id.icon_state = "gold" - id.access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() - id.registered_name = H.real_name - id.assignment = "Captain" - id.name = "[id.registered_name]'s ID Card ([id.assignment])" - W.front_id = id - else - id.icon_state = "gold" - id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() - else - id.icon_state = "gold" - id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() - else - var/obj/item/weapon/card/id/id = new/obj/item/weapon/card/id(M); + var/obj/item/worn = H.wear_id + var/obj/item/weapon/card/id/id = null + if(worn) id = worn.GetID() + if(id) id.icon_state = "gold" - id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() + id.access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() + else + id = new /obj/item/weapon/card/id/gold(H.loc) + id.access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() id.registered_name = H.real_name id.assignment = "Captain" id.name = "[id.registered_name]'s ID Card ([id.assignment])" - H.equip_to_slot_or_del(id, slot_wear_id) - H.update_inv_wear_id() + + if(worn) + if(istype(worn,/obj/item/device/pda)) + worn:id = id + id.loc = worn + else if(istype(worn,/obj/item/weapon/storage/wallet)) + worn:front_id = id + id.loc = worn + worn.update_icon() + else + H.equip_to_slot(id,slot_wear_id) + // otherwise leave it on the floor else alert("Invalid mob") feedback_add_details("admin_verb","GFA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! From 941631b664fddb5afaef989960183fefe83cb521 Mon Sep 17 00:00:00 2001 From: supersayu Date: Thu, 18 Jul 2013 23:22:32 -0400 Subject: [PATCH 7/7] Removes the spacevine-attack code --- code/game/objects/structures/tables_racks.dm | 28 +++----------------- code/game/turfs/simulated/floor.dm | 5 ---- code/modules/admin/verbs/debug.dm | 5 ++-- 3 files changed, 7 insertions(+), 31 deletions(-) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index e95addd3d4a..3801eafcd69 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -309,11 +309,6 @@ del(src) return - var/obj/effect/spacevine/vine = locate() in loc - if(vine) // don't drop things on tables when trying to attack spacevines - vine.attackby(W,user) - return - if(isrobot(user)) return @@ -330,7 +325,7 @@ return user.drop_item(src) - return + return 1 /* @@ -368,11 +363,6 @@ del(src) return - var/obj/effect/spacevine/vine = locate() in loc - if(vine) // don't drop things on tables when trying to attack spacevines - vine.attackby(W,user) - return - if(isrobot(user)) return if(istype(W, /obj/item/weapon/melee/energy/blade)) @@ -389,7 +379,7 @@ user.drop_item(src) //if(W && W.loc) W.loc = src.loc - return + return 1 /* @@ -420,11 +410,6 @@ del(W) return - var/obj/effect/spacevine/vine = locate() in loc - if(vine) // don't drop things on tables when trying to attack spacevines - vine.attackby(W,user) - return - if (istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W if(WT.remove_fuel(0, user)) @@ -475,7 +460,7 @@ user.drop_item(src) //if(W && W.loc) W.loc = src.loc - return + return 1 /* @@ -539,16 +524,11 @@ del(src) return - var/obj/effect/spacevine/vine = locate() in loc - if(vine) // don't drop things on racks when trying to attack spacevines - vine.attackby(W,user) - return - if(isrobot(user)) return user.drop_item() if(W && W.loc) W.loc = src.loc - return + return 1 /obj/structure/rack/meteorhit(obj/O as obj) del(src) diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 12cfc6cff89..d2498752e81 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -531,8 +531,3 @@ turf/simulated/floor/proc/update_icon() broken = 0 else user << "\blue You need more welding fuel to complete this task." - if(istype(C,/obj/item/weapon/scythe)) - var/obj/effect/spacevine/vine = locate() in src - if(vine) - vine.attackby(C,user) - return \ No newline at end of file diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 6cc3438fba4..60957386fcd 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -442,7 +442,8 @@ var/global/list/g_fancy_list_of_safe_types = null var/mob/living/carbon/human/H = M var/obj/item/worn = H.wear_id var/obj/item/weapon/card/id/id = null - if(worn) id = worn.GetID() + if(worn) + id = worn.GetID() if(id) id.icon_state = "gold" id.access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access() @@ -463,7 +464,7 @@ var/global/list/g_fancy_list_of_safe_types = null worn.update_icon() else H.equip_to_slot(id,slot_wear_id) - // otherwise leave it on the floor + else alert("Invalid mob") feedback_add_details("admin_verb","GFA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!