From 2c65e0901c45d10f49608a834f590a88d6cd34e4 Mon Sep 17 00:00:00 2001 From: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com> Date: Mon, 24 Oct 2022 16:48:42 -0400 Subject: [PATCH] Fixes an exploit with the power gloves (#19502) --- code/_onclick/click_override.dm | 3 +++ code/modules/clothing/gloves/color.dm | 1 + 2 files changed, 4 insertions(+) diff --git a/code/_onclick/click_override.dm b/code/_onclick/click_override.dm index d5feafb450f..4ac87220a7d 100644 --- a/code/_onclick/click_override.dm +++ b/code/_onclick/click_override.dm @@ -60,6 +60,9 @@ to_chat(user, "There is no cable here to power the gloves.") return var/turf/target_turf = get_turf(A) + if(get_dist(T, target_turf) > P.shock_range) + to_chat(user, "The target is too far away.") + return target_turf.hotspot_expose(2000, 400) playsound(user.loc, 'sound/effects/eleczap.ogg', 40, 1) diff --git a/code/modules/clothing/gloves/color.dm b/code/modules/clothing/gloves/color.dm index 32ecbc6c853..59df757827f 100644 --- a/code/modules/clothing/gloves/color.dm +++ b/code/modules/clothing/gloves/color.dm @@ -17,6 +17,7 @@ var/last_shocked = 0 var/shock_delay = 40 var/unlimited_power = FALSE // Does this really need explanation? + var/shock_range = 7 /obj/item/clothing/gloves/color/yellow/power/detailed_examine_antag() return "These are a pair of power gloves, and can be used to fire bolts of electricity while standing over powered power cables."