Don't assert() in to_float(), just clamp the return value
Fixes #120 might still be worth to investigate why the values go out of range in the first place
This commit is contained in:
parent
0332697159
commit
605e45ede0
1 changed files with 3 additions and 4 deletions
|
@ -155,10 +155,9 @@ float to_float_no_range_check(int value, int min, int max)
|
|||
|
||||
float to_float(int value, int min, int max)
|
||||
{
|
||||
assert(value >= min);
|
||||
assert(value <= max);
|
||||
|
||||
return to_float_no_range_check(value, min, max);
|
||||
return Math::clamp(-1.0f,
|
||||
to_float_no_range_check(value, min, max),
|
||||
1.0f);
|
||||
}
|
||||
|
||||
int from_float(float value, int min, int max)
|
||||
|
|
Loading…
Reference in a new issue