TGUI number input clamps values to match old behavior (#30767)

* Works for non-tgui.

* Removed a round by accident
This commit is contained in:
Vi3trice
2025-10-26 09:00:11 -04:00
committed by GitHub
parent 0c09df6bb3
commit 200745491a
+1 -5
View File
@@ -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)