1
This commit is contained in:
parent
7c2b15da5f
commit
560bc927ab
@ -37,7 +37,7 @@ class Present extends basewrap.BaseWrap {
|
||||
const rand = utils.randRange(0, this._totalSpace);
|
||||
for (let i in this._items) {
|
||||
const item = this._items[i];
|
||||
if (rand >= item['space']) {
|
||||
if (rand < item['space']) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ class Present extends BaseService {
|
||||
const list = [];
|
||||
metaFactory.traverseMetaList('Present' + name, (item) => {
|
||||
list.push(item);
|
||||
return true;
|
||||
});
|
||||
await this.processList(name, list);
|
||||
}
|
||||
@ -32,8 +33,10 @@ class Present extends BaseService {
|
||||
async processList(name, list) {
|
||||
for (let i in list){
|
||||
const presentMeta = list[i];
|
||||
console.log(presentMeta);
|
||||
const randItem = presentMeta.randItem();
|
||||
if (randItem) {
|
||||
console.log(11111);
|
||||
const itemId = randItem['itemId'];
|
||||
const tokenType = randItem['tokenType'];
|
||||
for (let ii = 0; ii < presentMeta.getCount(); ++ii) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user