From d3f780bf1ab2e7a5a6cd339c55b23b9b4756d4d5 Mon Sep 17 00:00:00 2001 From: Aronai Sieyes Date: Thu, 15 Jul 2021 14:41:52 -0400 Subject: [PATCH] Allow emptying contents from nearby bags --- code/game/objects/items/weapons/storage/storage.dm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 35bb5e6d27c..74ce48948ff 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -662,9 +662,20 @@ /obj/item/weapon/storage/verb/quick_empty() set name = "Empty Contents" set category = "Object" + set src in view(1) - if(((!(ishuman(usr) || isrobot(usr))) && (src.loc != usr)) || usr.stat || usr.restrained()) + // Only humans and robots can dump contents + if(!(ishuman(usr) || isrobot(usr))) return + + // Hard to do when you're KO'd + if(usr.incapacitated()) + return + + // Has to be at least adjacent (just for safety, src in view should handle this already) + if(!Adjacent(usr)) + return + drop_contents() /obj/item/weapon/storage/proc/drop_contents() // why is this a proc? literally just for RPEDs