From a5243dbcc4c4e160c02ea829f3bf6b0029d5162c Mon Sep 17 00:00:00 2001 From: ZomgPonies Date: Sat, 28 Dec 2013 11:45:36 -0500 Subject: [PATCH] Emptying other players inv puts item in your hands --- code/modules/mob/inventory.dm | 22 +++++-------------- code/modules/mob/living/carbon/human/human.dm | 2 +- .../mob/living/carbon/human/inventory.dm | 13 +++++++++-- .../mob/living/carbon/monkey/inventory.dm | 9 +++++++- 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index d3862b5b4af..88362f33ecb 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -61,23 +61,11 @@ //Puts the item our active hand if possible. Failing that it tries our inactive hand. Returns 1 on success. //If both fail it drops it on the floor and returns 0. //This is probably the main one you need to know :) -/mob/proc/put_in_hands(var/obj/item/W) - if(!W) return 0 - if(put_in_active_hand(W)) - update_inv_l_hand() - update_inv_r_hand() - return 1 - else if(put_in_inactive_hand(W)) - update_inv_l_hand() - update_inv_r_hand() - return 1 - else - W.loc = get_turf(src) - W.layer = initial(W.layer) - W.dropped() - return 0 - - +//Just puts stuff on the floor for most mobs, since all mobs have hands but putting stuff in the AI/corgi/ghost hand is VERY BAD. +/mob/proc/put_in_hands(obj/item/W) + W.loc = get_turf(src) + W.layer = initial(W.layer) + W.dropped() /mob/proc/drop_item_v() //this is dumb. if(stat == CONSCIOUS && isturf(loc)) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 9b94b22085a..79548d00e7a 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -553,7 +553,7 @@ if(do_mob(usr, src, STRIP_DELAY)) if(pocket_item) u_equip(pocket_item) - if(pickpocket) usr.put_in_hands(pocket_item) + usr.put_in_hands(pocket_item) else if(place_item) usr.u_equip(place_item) diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 12c5b326a91..63a7a0dfdea 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -326,13 +326,20 @@ src.u_equip(W) W.loc = src.back else - src << "\red You are trying to eqip this item to an unsupported inventory slot. How the heck did you manage that? Stop it..." + src << "You are trying to equip this item to an unsupported inventory slot. Report this to a coder!" return W.layer = 20 return +/mob/living/carbon/human/put_in_hands(obj/item/W) + if(!W) return 0 + if(put_in_active_hand(W)) return 1 + else if(put_in_inactive_hand(W)) return 1 + else + ..() + /obj/effect/equip_e name = "equip e" var/mob/source = null @@ -785,4 +792,6 @@ It can still be worn/put on as normal. return l_hand if(slot_r_hand) return r_hand - return null \ No newline at end of file + return null + + diff --git a/code/modules/mob/living/carbon/monkey/inventory.dm b/code/modules/mob/living/carbon/monkey/inventory.dm index e9f57611620..cfb4029609f 100644 --- a/code/modules/mob/living/carbon/monkey/inventory.dm +++ b/code/modules/mob/living/carbon/monkey/inventory.dm @@ -233,4 +233,11 @@ W.layer = 20 - return \ No newline at end of file + return + +/mob/living/carbon/monkey/put_in_hands(obj/item/W) + if(!W) return 0 + if(put_in_active_hand(W)) return 1 + else if(put_in_inactive_hand(W)) return 1 + else + ..()