From 476af103ac28374fe06974df05e5b19fc9648c26 Mon Sep 17 00:00:00 2001 From: MistakeNot4892 Date: Sat, 21 Jan 2023 22:34:10 +1100 Subject: [PATCH] Cleans up drop_from_inventory overrides. --- code/modules/mob/inventory.dm | 9 +++------ code/modules/mob/living/carbon/human/human.dm | 6 ++---- code/modules/mob/living/living.dm | 6 ++---- code/modules/mob/living/simple_mob/hands.dm | 9 +-------- 4 files changed, 8 insertions(+), 22 deletions(-) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 3534a3a482..d4a93bd4df 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -149,10 +149,8 @@ var/global/list/slot_equipment_priority = list( \ /mob/proc/drop_from_inventory(var/obj/item/W, var/atom/target) if(W) remove_from_mob(W, target) - if(!(W && W.loc)) - return 1 // self destroying objects (tk, grabs) - return 1 - return 0 + return TRUE + return FALSE //Drops the item in our left hand /mob/proc/drop_l_hand(var/atom/Target) @@ -222,8 +220,7 @@ var/global/list/slot_equipment_priority = list( \ else I.dropInto(drop_location()) I.dropped(src) - return 1 - + return TRUE //Returns the item equipped to the specified slot, if any. /mob/proc/get_equipped_item(var/slot) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index cf7fc5d1c5..9f89e5223a 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1387,10 +1387,8 @@ to_chat(S, "[U] pops your [current_limb.joint] back in!") current_limb.relocate() -/mob/living/carbon/human/drop_from_inventory(var/obj/item/W, var/atom/Target = null) - if(W in organs) - return - ..() +/mob/living/carbon/human/drop_from_inventory(var/obj/item/W, var/atom/target = null) + return !(W in organs) && ..() /mob/living/carbon/human/reset_view(atom/A, update_hud = 1) ..() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 572a462819..3f4dd459c5 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -714,10 +714,8 @@ /mob/living/proc/slip(var/slipped_on,stun_duration=8) return FALSE -/mob/living/carbon/drop_from_inventory(var/obj/item/W, var/atom/Target = null) - if(W in internal_organs) - return - ..() +/mob/living/carbon/drop_from_inventory(var/obj/item/W, var/atom/target = null) + return !(W in internal_organs) && ..() /mob/living/touch_map_edge() diff --git a/code/modules/mob/living/simple_mob/hands.dm b/code/modules/mob/living/simple_mob/hands.dm index 8ec2158d65..3c9d05ed58 100644 --- a/code/modules/mob/living/simple_mob/hands.dm +++ b/code/modules/mob/living/simple_mob/hands.dm @@ -135,13 +135,6 @@ to_chat(src, "Your [hand_form] are not fit for use of \the [display_name].") return humanoid_hands -/mob/living/simple_mob/drop_from_inventory(var/obj/item/W, var/atom/target = null) - . = ..(W, target) - if(!target) - target = src.loc - if(.) - W.forceMove(src.loc) - /mob/living/simple_mob/is_holding_item_of_type(typepath) for(var/obj/item/I in list(l_hand, r_hand)) if(istype(I, typepath)) @@ -153,4 +146,4 @@ if(l_hand) . += l_hand if(r_hand) - . += r_hand \ No newline at end of file + . += r_hand