活动:新将抽卡添加固定奖励
This commit is contained in:
@@ -93,7 +93,18 @@ export async function addReward(roleId: string, roleName: string, sid: string, s
|
||||
goods = goods.concat(heroResult.goods)
|
||||
addHeros = addHeros.concat(heroResult.heroes);
|
||||
}
|
||||
return { goods, addHeros }
|
||||
|
||||
let newGoods: RewardInter[] = [];
|
||||
for (let item of goods) {
|
||||
let index = newGoods.findIndex(obj => { return obj.id == item.id });
|
||||
if (index != -1) {
|
||||
newGoods[index].count += item.count;
|
||||
} else {
|
||||
newGoods.push({ id: item.id, count: item.count })
|
||||
}
|
||||
}
|
||||
|
||||
return { goods: newGoods, addHeros }
|
||||
}
|
||||
|
||||
//表中的奖励数据(包括礼包)转换成具体对应奖励物品的实例
|
||||
|
||||
Reference in New Issue
Block a user