Fixed clamping

This commit is contained in:
Ishaan Bhardwaj 2021-03-04 18:44:30 -05:00 committed by GitHub
parent 57518dc299
commit e7bb44deb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,6 +87,6 @@ function table.contains(table, element)
return false return false
end end
function clamp(a, b, c) function clamp(x, min, max)
return math.min(a, math.max(b, c)) return (x < min and min or (x > max and max or x))
end end