From e7bb44deb4a1245e2b8de7a001fdf2869ff5a44d Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj <59454579+SashLilac@users.noreply.github.com> Date: Thu, 4 Mar 2021 18:44:30 -0500 Subject: [PATCH] Fixed clamping --- funcs.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/funcs.lua b/funcs.lua index 7c017ce..e55bcf5 100644 --- a/funcs.lua +++ b/funcs.lua @@ -87,6 +87,6 @@ function table.contains(table, element) return false end -function clamp(a, b, c) - return math.min(a, math.max(b, c)) -end \ No newline at end of file +function clamp(x, min, max) + return (x < min and min or (x > max and max or x)) +end