diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index c12249ace8a..3fce65f1ff0 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -39,38 +39,38 @@ show_to(M) return - if(!( istype(over_object, /obj/screen) )) - if(Adjacent(M)) - if( istype(over_object, /obj/item/weapon/storage) ) //Check if storage item - var/obj/item/weapon/storage/S = over_object - orient2hud(M) - if(M.s_active) - M.s_active.close(M) + if(!( M.restrained() ) && !( M.stat )) // I'M PRETTY SURE THIS IS ALREADY HANDLED SOMEWHERE ELSE + if(!( istype(over_object, /obj/screen) )) + if(Adjacent(M) && over_object.Adjacent(M)) + playsound(loc, "rustle", 50, 1, -5) + if( istype(over_object, /obj/item/weapon/storage) ) //Check if storage item + var/obj/item/weapon/storage/S = over_object + orient2hud(M) + if(M.s_active) //refresh the HUD + M.s_active.close(M) + show_to(M) + for(var/obj/item/I in src) + if(S.can_be_inserted(I,0,M)) + remove_from_storage(I, S) + return + + if( istype(over_object, /obj/machinery/disposal) ) //Check if it's a bin + for(var/obj/item/I in src) + remove_from_storage(I, over_object) //No check needed, put everything inside + return + + var/turf/T = get_turf(over_object) //Get_turf, and check if the turf isn't a wall + if( istype(T, /turf/simulated/wall) ) + return + for(var/obj/item/I in src) - if(S.can_be_inserted(I,0,M)) - remove_from_storage(I, S) + remove_from_storage(I, T) return - if( istype(over_object, /obj/machinery/disposal) ) //Check if it's a bin - for(var/obj/item/I in src) - remove_from_storage(I, over_object) //No check needed, put everything inside - return - - var/turf/T = get_turf(over_object) //Get_turf, and check if the turf isn't a wall - if( istype(T, /turf/simulated/wall) ) - return - - for(var/obj/item/I in src) - remove_from_storage(I, T) + if(!(loc == usr) || (loc && loc.loc == usr)) return - return ..() - - if(!(loc == usr) || (loc && loc.loc == usr)) - return - - playsound(loc, "rustle", 50, 1, -5) - if(!( M.restrained() ) && !( M.stat )) + playsound(loc, "rustle", 50, 1, -5) switch(over_object.name) if("r_hand") if(!M.unEquip(src)) @@ -82,8 +82,6 @@ M.put_in_l_hand(src) add_fingerprint(usr) - - /obj/item/weapon/storage/proc/return_inv() var/list/L = list() L += contents