From cca96c5e15423125c4dfd9790d6205e339f9c133 Mon Sep 17 00:00:00 2001 From: warriorstar-orion Date: Tue, 13 May 2025 00:02:24 -0400 Subject: [PATCH] restrict food tray pickup items to food, fix sliceable tray click pickup (#29216) --- code/game/objects/items/weapons/storage/bags.dm | 6 +++++- code/modules/food_and_drinks/food_base.dm | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm index 59bdead8af4..fbf1409c878 100644 --- a/code/game/objects/items/weapons/storage/bags.dm +++ b/code/game/objects/items/weapons/storage/bags.dm @@ -361,7 +361,11 @@ flags = CONDUCT slot_flags = null materials = list(MAT_METAL=3000) - cant_hold = list(/obj/item/disk/nuclear) // Prevents some cheesing + can_hold = list( + /obj/item/food, + /obj/item/reagent_containers/drinks, + /obj/item/reagent_containers/condiment, + ) /obj/item/storage/bag/tray/attack__legacy__attackchain(mob/living/M, mob/living/user) ..() diff --git a/code/modules/food_and_drinks/food_base.dm b/code/modules/food_and_drinks/food_base.dm index 2866671b1f9..0461d6f0a79 100644 --- a/code/modules/food_and_drinks/food_base.dm +++ b/code/modules/food_and_drinks/food_base.dm @@ -330,7 +330,7 @@ if(istype(I, /obj/item/kitchen/knife) || istype(I, /obj/item/scalpel)) inaccurate = FALSE else - return TRUE + return ..() if(!isturf(loc) || !(locate(/obj/structure/table) in loc) && \ !(locate(/obj/machinery/optable) in loc) && !(locate(/obj/item/storage/bag/tray) in loc)) to_chat(user, "You cannot slice [src] here! You need a table or at least a tray to do it.")