From 4ab98ea3f82bb8f6ef51208af58076a5c7098eb8 Mon Sep 17 00:00:00 2001 From: Contrabang <91113370+Contrabang@users.noreply.github.com> Date: Thu, 14 Jul 2022 03:01:02 -0700 Subject: [PATCH] Cultists can now reliably find their cult dagger (#18367) * cult find thing good * return null * extra space be gone --- code/modules/mob/inventory.dm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index f11f53dd078..f845e95dc40 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -276,12 +276,10 @@ return r_hand return null -//search for a path in inventory and storage items in that inventory (backpack, belt, etc) and return it. Not recursive, so doesnt search storage in storage +//search for a path in inventory and storage items in that inventory (backpack, belt, etc) and return it. /mob/proc/find_item(path) - for(var/obj/item/I in contents) - if(istype(I, /obj/item/storage)) - for(var/obj/item/SI in I.contents) - if(istype(SI, path)) - return SI - else if(istype(I, path)) - return I + var/list/L = get_contents() + + for(var/obj/B in L) + if(B.type == path) + return B