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