From 0a1380c766c02bdb92a0825b73d18d7050185cf8 Mon Sep 17 00:00:00 2001 From: NovaBot <154629622+NovaBot13@users.noreply.github.com> Date: Tue, 19 Mar 2024 22:04:46 -0400 Subject: [PATCH] [MIRROR] Stops cluster grenades from spamming admins (#1537) * Stops cluster grenades from spamming admins (#82090) ## About The Pull Request Stops cluster grenades from logging their children. ## Why It's Good For The Game Helps out with https://github.com/tgstation/tgstation/issues/81865. ## Changelog :cl: admin: cluster bombs stop spamming admin logs /:cl: * Stops cluster grenades from spamming admins --------- Co-authored-by: Bilbo367 <163439532+Bilbo367@users.noreply.github.com> --- code/game/objects/items/grenades/_grenade.dm | 5 ++++- code/game/objects/items/grenades/clusterbuster.dm | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/grenades/_grenade.dm b/code/game/objects/items/grenades/_grenade.dm index bb1cade96b8..e7e592eabac 100644 --- a/code/game/objects/items/grenades/_grenade.dm +++ b/code/game/objects/items/grenades/_grenade.dm @@ -22,6 +22,8 @@ var/dud_flags = NONE ///Is this grenade currently armed? var/active = FALSE + ///Is it a cluster grenade? We dont wanna spam admin logs with these. + var/type_cluster = FALSE ///How long it takes for a grenade to explode after being armed var/det_time = 5 SECONDS ///Will this state what it's det_time is when examined? @@ -135,7 +137,8 @@ arm_grenade(user) /obj/item/grenade/proc/log_grenade(mob/user) - log_bomber(user, "has primed a", src, "for detonation", message_admins = !dud_flags) + if(!type_cluster) + log_bomber(user, "has primed a", src, "for detonation", message_admins = dud_flags != NONE) /** * arm_grenade (formerly preprime) refers to when a grenade with a standard time fuze is activated, making it go beepbeepbeep and then detonate a few seconds later. diff --git a/code/game/objects/items/grenades/clusterbuster.dm b/code/game/objects/items/grenades/clusterbuster.dm index e4862919c1c..b27285e0786 100644 --- a/code/game/objects/items/grenades/clusterbuster.dm +++ b/code/game/objects/items/grenades/clusterbuster.dm @@ -95,6 +95,7 @@ var/obj/item/grenade/grenade = new type(loc) if(istype(grenade)) grenade.active = TRUE + grenade.type_cluster = TRUE addtimer(CALLBACK(grenade, TYPE_PROC_REF(/obj/item/grenade, detonate)), rand(RANDOM_DETONATE_MIN_TIME, RANDOM_DETONATE_MAX_TIME)) var/steps = rand(1, 4) for(var/step in 1 to steps)