From 3be7d6d8ef268f5a515c2f2ecee99afc8cfe2e23 Mon Sep 17 00:00:00 2001 From: "baloh.matevz" Date: Fri, 17 Aug 2012 16:19:04 +0000 Subject: [PATCH] - Fixes issue 812. - Adds logging for throwing. Pulling and grabbing does not need to be logged in detail, since kill-intent grabbing is logged already. - Something broke throwing, which made it runtime. This also fixes that. - Fixes the problem of applying wires to a stack of glass, which only contains one piece of glass using wires, deleting the glass piece and not spawning a light tile. A call of the glass' use(1) was misplaced, which had the chance of deleting the object, thus stopping the proc, before it spawned the light tile. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4478 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/objects/stacks/glass.dm | 8 +------- code/game/throwing.dm | 21 +++++++++++++++++---- code/modules/mob/mob_grab.dm | 6 +++--- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/code/game/objects/stacks/glass.dm b/code/game/objects/stacks/glass.dm index c52585376a7..645936a6fc2 100644 --- a/code/game/objects/stacks/glass.dm +++ b/code/game/objects/stacks/glass.dm @@ -19,15 +19,9 @@ SHARDS user << "\b There is not enough wire in this coil. You need 5 lengths." return CC.use(5) - src.use(1) user << "\blue You attach wire to the [name]." new /obj/item/stack/light_w(user.loc) - if(CC && CC.amount <= 0) //CC may have already been deleted by 'CC.use(5)' a few lines up. - user.u_equip(CC) - del(CC) - if(src.amount <= 0) - user.u_equip(src) - del(src) + src.use(1) else if( istype(W, /obj/item/stack/rods) ) var/obj/item/stack/rods/V = W var/obj/item/stack/sheet/rglass/RG = new (user.loc) diff --git a/code/game/throwing.dm b/code/game/throwing.dm index b0ffcacb647..884557438a8 100644 --- a/code/game/throwing.dm +++ b/code/game/throwing.dm @@ -27,7 +27,6 @@ /mob/living/carbon/proc/throw_item(atom/target) src.throw_mode_off() - if(usr.stat || !target) return if(target.type == /obj/screen) return @@ -36,14 +35,28 @@ if(!item) return + if (istype(item, /obj/item/weapon/grab)) + var/obj/item/weapon/grab/G = item + item = G.throw() //throw the person instead of the grab + if(ismob(item)) + var/turf/start_T = get_turf(loc) //Get the start and target tile for the descriptors + var/turf/end_T = get_turf(target) + if(start_T && end_T) + var/mob/M = item + var/start_T_descriptor = "tile at [start_T.x], [start_T.y], [start_T.z] in area [get_area(start_T)]" + var/end_T_descriptor = "tile at [end_T.x], [end_T.y], [end_T.z] in area [get_area(end_T)]" + + M.attack_log += text("\[[time_stamp()]\] Has been thrown by [usr.name] ([usr.ckey]) from [start_T_descriptor] with the target [end_T_descriptor]") + usr.attack_log += text("\[[time_stamp()]\] Has thrown [M.name] ([M.ckey]) from [start_T_descriptor] with the target [end_T_descriptor]") + + if(!item) return //Grab processing has a chance of returning null + u_equip(item) update_icons() if(src.client) src.client.screen -= item - item.loc = src.loc - if (istype(item, /obj/item/weapon/grab)) - item = item:throw() //throw the person instead of the grab + item.loc = src.loc if(istype(item, /obj/item)) item:dropped(src) // let it know it's been dropped diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index 60e01b7c661..31a79218fb8 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -21,17 +21,17 @@ if(affecting) if(state >= 2) var/grabee = affecting - spawn(0) + spawn(1) del(src) return grabee else - spawn(0) + spawn(1) del(src) return null else if(structure) var/grabee = structure - spawn(0) + spawn(1) del(src) return grabee