Fixes a niche dufflebag issue (#19883)

* fixes chat issues

* removal fixes

* this
This commit is contained in:
S34N
2022-12-19 14:32:49 +00:00
committed by GitHub
parent ebf2d2b18f
commit d55f6d10da
6 changed files with 35 additions and 6 deletions
@@ -383,9 +383,12 @@
playsound(src, 'sound/items/zip.ogg', 75, TRUE)
zipped = !zipped
if(!zipped && zip_time) // Handle slowdown and stuff now that we just zipped it
slowdown = 1
if(!zipped) // Handle slowdown and stuff now that we just zipped it
show_to(user)
if(zip_time)
slowdown = 1
return
slowdown = 0
@@ -395,14 +398,24 @@
// The following three procs handle refusing access to contents if the duffel is zipped
/obj/item/storage/backpack/duffel/handle_item_insertion(obj/item/I, prevent_warning)
/obj/item/storage/backpack/duffel/handle_item_insertion(obj/item/I, prevent_warning, bypass_zip = FALSE)
if(bypass_zip)
return ..()
if(zipped)
to_chat(usr, "<span class='notice'>[src] is zipped shut!</span>")
return FALSE
return ..()
/obj/item/storage/backpack/duffel/remove_from_storage(obj/item/I, atom/new_location)
/obj/item/storage/backpack/duffel/removal_allowed_check(mob/user)
if(zipped)
to_chat(user, "<span class='notice'>[src] is zipped shut!</span>")
return FALSE
return TRUE
/obj/item/storage/backpack/duffel/drop_inventory(user)
if(zipped)
to_chat(usr, "<span class='notice'>[src] is zipped shut!</span>")
return FALSE
@@ -93,6 +93,9 @@
continue
hide_from(player)
/obj/item/storage/proc/removal_allowed_check(mob/user)
return TRUE
/obj/item/storage/MouseDrop(obj/over_object)
if(!ismob(usr)) //so monkeys can take off their backpacks -- Urist
return
@@ -110,6 +113,9 @@
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)
if(!removal_allowed_check(M))
return
if(isfloorturf(over_object))
if(get_turf(M) != T)
return // Can only empty containers onto the floor under you
@@ -580,6 +586,8 @@
if((!ishuman(usr) && (loc != usr)) || usr.stat || usr.restrained())
return
if(!removal_allowed_check(usr))
return
drop_inventory(usr)