parent
2af3bf426b
commit
7676fc3142
@ -240,7 +240,7 @@ export function ctor() {
|
||||
}
|
||||
|
||||
Array.prototype.random = function (this: Array<any>) {
|
||||
return this[PublicShared.randomNum(0, this.length)];
|
||||
return this[PublicShared.randomNum(0, this.length - 1)];
|
||||
};
|
||||
|
||||
Array.prototype.intersection = function (this: Array<any>, other: Array<any>) {
|
||||
|
@ -116,7 +116,7 @@ export class PublicShared {
|
||||
* 随机生成区间范围整数
|
||||
*/
|
||||
static randomNum(min: number, max: number) {
|
||||
return Math.floor(Math.random() * (max - min) + min);
|
||||
return Math.floor(Math.random() * (max - min + 1) + min);
|
||||
}
|
||||
/**获取道具配置 */
|
||||
static getAtnConf(atn: prizeType) {
|
||||
|
Loading…
Reference in New Issue
Block a user