mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 08:34:16 +01:00
Adds storage dumping (#29641)
* added storage dumping * retain in storage item shuffling
This commit is contained in:
@@ -103,6 +103,17 @@
|
||||
/obj/item/storage/proc/removal_allowed_check(mob/user)
|
||||
return TRUE
|
||||
|
||||
/obj/item/storage/proc/dump_storage(mob/user, obj/item/storage/target)
|
||||
if(!length(contents) || user.restrained() || (HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) || !user.can_reach(target) || src == target)
|
||||
return
|
||||
for(var/obj/item/thing in contents)
|
||||
if(!target.can_be_inserted(thing))
|
||||
continue
|
||||
if(!do_after(user, 0.3 SECONDS, target = user))
|
||||
break
|
||||
playsound(loc, "rustle", 50, TRUE, -5)
|
||||
target.handle_item_insertion(thing, user)
|
||||
|
||||
/obj/item/storage/MouseDrop(obj/over_object, src_location, over_location, src_control, over_control, params)
|
||||
if(!ismob(usr)) //so monkeys can take off their backpacks -- Urist
|
||||
return
|
||||
@@ -117,6 +128,16 @@
|
||||
open(M)
|
||||
return
|
||||
|
||||
if(isstorage(over_object))
|
||||
var/obj/item/storage = over_object
|
||||
if(!storage.in_storage)
|
||||
dump_storage(M, over_object)
|
||||
return
|
||||
else if(ismodcontrol(over_object))
|
||||
var/obj/item/mod/control/mod = over_object
|
||||
dump_storage(M, mod.bag)
|
||||
return
|
||||
|
||||
if((istype(over_object, /obj/structure/table) || isfloorturf(over_object)) && length(contents) \
|
||||
&& loc == M && !M.stat && !M.restrained() && !HAS_TRAIT(M, TRAIT_HANDS_BLOCKED) && over_object.Adjacent(M) && !istype(src, /obj/item/storage/lockbox)) // Worlds longest `if()`
|
||||
var/turf/T = get_turf(over_object)
|
||||
|
||||
Reference in New Issue
Block a user