From 200745491ae4e809a39eec75656e47a1a870bed7 Mon Sep 17 00:00:00 2001 From: Vi3trice <80771500+Vi3trice@users.noreply.github.com> Date: Sun, 26 Oct 2025 09:00:11 -0400 Subject: [PATCH] TGUI number input clamps values to match old behavior (#30767) * Works for non-tgui. * Removed a round by accident --- code/modules/tgui/tgui_input/number_input.dm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/code/modules/tgui/tgui_input/number_input.dm b/code/modules/tgui/tgui_input/number_input.dm index 5afa06d6516..2838b08c6d3 100644 --- a/code/modules/tgui/tgui_input/number_input.dm +++ b/code/modules/tgui/tgui_input/number_input.dm @@ -153,11 +153,7 @@ if("submit") if(!isnum(params["entry"])) CRASH("A non number was input into TGUI Input Number by [usr]") - var/choice = round_value ? round(params["entry"]) : params["entry"] - if(choice > max_value) - CRASH("A number greater than the max value was input into TGUI Input Number by [usr]") - if(choice < min_value) - CRASH("A number less than the min value was input into TGUI Input Number by [usr]") + var/choice = clamp(round_value ? round(params["entry"]) : params["entry"], min_value, max_value) set_entry(choice) closed = TRUE SStgui.close_uis(src)