回滚公用方法

This commit is contained in:
dy 2023-12-29 01:07:27 +08:00
parent 8dfe0b4ce8
commit 89af066d12
2 changed files with 2 additions and 2 deletions

View File

@ -233,7 +233,7 @@ export function ctor() {
}
Array.prototype.random = function (this: Array<any>) {
return this[PublicShared.randomNum(0, this.length - 1)];
return this[PublicShared.randomNum(0, this.length)];
};
Array.prototype.intersection = function (this: Array<any>, other: Array<any>) {

View File

@ -115,7 +115,7 @@ export class PublicShared {
*
*/
static randomNum(min: number, max: number) {
return Math.floor(Math.random() * (max - min + 1) + min);
return Math.floor(Math.random() * (max - min) + min);
}
/**获取道具配置 */
static getAtnConf(atn: prizeType) {