From 39ecdb75d9b8396163601da2bf44449ad73f1da3 Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Wed, 9 Jul 2025 09:27:22 +0200 Subject: [PATCH] sanitize (#17979) * sanitize * Update shadekin.dm --- code/datums/components/species/shadekin/shadekin.dm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/code/datums/components/species/shadekin/shadekin.dm b/code/datums/components/species/shadekin/shadekin.dm index 921705e14a3..d768c771e79 100644 --- a/code/datums/components/species/shadekin/shadekin.dm +++ b/code/datums/components/species/shadekin/shadekin.dm @@ -221,6 +221,7 @@ switch(action) if("adjust_time") var/new_time = text2num(params["val"]) + new_time = CLAMP(new_time, 2, 20) if(!isnum(new_time)) return FALSE flicker_time = new_time @@ -234,14 +235,16 @@ ui.user.write_preference_directly(/datum/preference/color/living/flicker_color, set_new_color) return TRUE if("adjust_break") - var/new_brack_chance = text2num(params["val"]) - if(!isnum(new_brack_chance)) + var/new_break_chance = text2num(params["val"]) + new_break_chance = CLAMP(new_break_chance, 0, 25) + if(!isnum(new_break_chance)) return FALSE - flicker_break_chance = new_brack_chance - ui.user.write_preference_directly(/datum/preference/numeric/living/flicker_break_chance, new_brack_chance) + flicker_break_chance = new_break_chance + ui.user.write_preference_directly(/datum/preference/numeric/living/flicker_break_chance, new_break_chance) return TRUE if("adjust_distance") var/new_distance = text2num(params["val"]) + new_distance = CLAMP(new_distance, 4, 10) if(!isnum(new_distance)) return FALSE flicker_distance = new_distance