From ed54a8aaa7680892790e069c8ef6e62dddec543e Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 1 Apr 2015 05:35:59 -0700 Subject: [PATCH] Fixes #8693 --- code/modules/mob/inventory.dm | 6 +++--- code/modules/mob/living/carbon/carbon.dm | 9 ++++----- code/modules/mob/living/carbon/human/human.dm | 5 +++++ code/modules/mob/living/living.dm | 5 +++++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index ea56c749b8..829ee6e86d 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -151,7 +151,7 @@ var/list/slot_equipment_priority = list( \ remove_from_mob(W) if(!W) return 1 // self destroying objects (tk, grabs) - + W.forceMove(Target) update_icons() return 1 @@ -173,11 +173,11 @@ var/list/slot_equipment_priority = list( \ /* Removes the object from any slots the mob might have, calling the appropriate icon update proc. Does nothing else. - + DO NOT CALL THIS PROC DIRECTLY. It is meant to be called only by other inventory procs. It's probably okay to use it if you are transferring the item between slots on the same mob, but chances are you're safer calling remove_from_mob() or drop_from_inventory() anyways. - + As far as I can tell the proc exists so that mobs with different inventory slots can override the search through all the slots, without having to duplicate the rest of the item dropping. */ diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 63eba6e781..da10a9ea00 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -31,10 +31,9 @@ var/d = rand(round(I.force / 4), I.force) if(istype(src, /mob/living/carbon/human)) var/mob/living/carbon/human/H = src - var/organ = H.get_organ("chest") - if (istype(organ, /obj/item/organ/external)) - var/obj/item/organ/external/temp = organ - if(temp.take_damage(d, 0)) + var/obj/item/organ/external/organ = H.get_organ("chest") + if (istype(organ)) + if(organ.take_damage(d, 0)) H.UpdateDamageIcon() H.updatehealth() else @@ -328,7 +327,7 @@ if(!item) return //Grab processing has a chance of returning null - + src.remove_from_mob(item) item.loc = src.loc diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index a9f3b1a6c4..12c326606a 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1361,3 +1361,8 @@ U << "You pop [S]'s [current_limb.joint] back in!" S << "[U] pops your [current_limb.joint] back in!" current_limb.undislocate() + +/mob/living/carbon/human/drop_from_inventory(var/obj/item/W, var/atom/Target = null) + if(W in organs) + return + ..() \ No newline at end of file diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 00802c5da9..0bf4978297 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -967,6 +967,11 @@ default behaviour is: /mob/living/proc/slip(var/slipped_on,stun_duration=8) return 0 +/mob/living/carbon/drop_from_inventory(var/obj/item/W, var/atom/Target = null) + if(W in internal_organs) + return + ..() + /mob/living/carbon/proc/spin(spintime, speed) spawn() var/D = dir