0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-12 16:30:42 -05:00

Added fallback to randInt when min and max are the same

This commit is contained in:
Chomp 2024-12-10 00:09:43 +00:00
parent be31f7248f
commit 90b6f28f31

View File

@ -389,6 +389,10 @@ export class RandomUtil {
* @returns A random integer within the specified range.
*/
public randInt(low: number, high?: number): number {
if (low === high) {
return low;
}
if (typeof high !== "undefined") {
return crypto.randomInt(low, high);
}