mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 01:30:44 -05:00
Added fallback to randInt
when min and max are the same
This commit is contained in:
parent
be31f7248f
commit
90b6f28f31
@ -389,6 +389,10 @@ export class RandomUtil {
|
|||||||
* @returns A random integer within the specified range.
|
* @returns A random integer within the specified range.
|
||||||
*/
|
*/
|
||||||
public randInt(low: number, high?: number): number {
|
public randInt(low: number, high?: number): number {
|
||||||
|
if (low === high) {
|
||||||
|
return low;
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof high !== "undefined") {
|
if (typeof high !== "undefined") {
|
||||||
return crypto.randomInt(low, high);
|
return crypto.randomInt(low, high);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user