mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-09-29 15:12:58 -04:00
Clamp bell curve rolls to three deviations
This commit is contained in:
@@ -117,6 +117,21 @@ public class utils extends script.base_script
|
||||
}
|
||||
return am;
|
||||
}
|
||||
|
||||
public static double clamp(double value, double min, double max)
|
||||
{
|
||||
if (value < min)
|
||||
{
|
||||
return min;
|
||||
}
|
||||
else if (value > max)
|
||||
{
|
||||
return max;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public static int randix(float[] fArray) throws InterruptedException
|
||||
{
|
||||
if (fArray.length > 1)
|
||||
|
||||
Reference in New Issue
Block a user