From faf173b35c79e11468035a2f255ff5265840aee9 Mon Sep 17 00:00:00 2001 From: KalevTait <107985691+KalevTait@users.noreply.github.com> Date: Mon, 27 Jun 2022 13:25:34 +0100 Subject: [PATCH] Glass container reagents saftey check (#18096) * changed fake disintegrate to not need a permit (as far as sec bots are concerned) * prefer boolean defines to magic numbers Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> * added check * Update code/modules/reagents/reagent_containers/glass_containers.dm Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> --- code/modules/reagents/reagent_containers/glass_containers.dm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/modules/reagents/reagent_containers/glass_containers.dm b/code/modules/reagents/reagent_containers/glass_containers.dm index f9817b26b82..15d3769e4bc 100644 --- a/code/modules/reagents/reagent_containers/glass_containers.dm +++ b/code/modules/reagents/reagent_containers/glass_containers.dm @@ -68,12 +68,15 @@ playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1) /obj/item/reagent_containers/glass/afterattack(obj/target, mob/user, proximity) - if((!proximity) || !check_allowed_items(target,target_self = TRUE)) + if((!proximity) || !check_allowed_items(target, target_self = TRUE)) return if(!is_open_container()) return + if(!reagents) + return + if(target.is_refillable()) //Something like a glass. Player probably wants to transfer TO it. if(!reagents.total_volume) to_chat(user, "[src] is empty!")