mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Fixes a niche dufflebag issue (#19883)
* fixes chat issues * removal fixes * this
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -336,6 +336,9 @@
|
||||
else
|
||||
if(isstorage(I.loc))
|
||||
var/obj/item/storage/S = I.loc
|
||||
if(!S.removal_allowed_check(user))
|
||||
return
|
||||
|
||||
S.remove_from_storage(I, src)
|
||||
else if(ismob(I.loc))
|
||||
var/mob/M = I.loc
|
||||
|
||||
@@ -203,6 +203,9 @@
|
||||
return
|
||||
else if(isstorage(O.loc))
|
||||
var/obj/item/storage/S = O.loc
|
||||
if(!S.removal_allowed_check(user))
|
||||
return
|
||||
|
||||
S.remove_from_storage(O, src)
|
||||
|
||||
for(var/datum/seed_pile/N in piles) //this for loop physically hurts me
|
||||
|
||||
@@ -249,8 +249,8 @@
|
||||
//Mob can't equip it. Put it their backpack or toss it on the floor
|
||||
if(isstorage(back))
|
||||
var/obj/item/storage/S = back
|
||||
//Now, B represents a container we can insert W into.
|
||||
S.handle_item_insertion(W,1)
|
||||
//Now, S represents a container we can insert W into.
|
||||
S.handle_item_insertion(W, TRUE, TRUE)
|
||||
return S
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
|
||||
if(isstorage(I))
|
||||
var/obj/item/storage/S = I
|
||||
if(!S.removal_allowed_check(user))
|
||||
return
|
||||
if((S.allow_quick_empty || S.allow_quick_gather) && S.contents.len)
|
||||
S.hide_from(user)
|
||||
user.visible_message("[user] empties \the [S] into \the [src].", "You empty \the [S] into \the [src].")
|
||||
|
||||
Reference in New Issue
Block a user