fix 藏宝图格式不一致
This commit is contained in:
@@ -19,7 +19,7 @@ export class WarReward {
|
||||
private condition: Map<number, boolean>;
|
||||
private warInfo: any;
|
||||
private isSuccess: boolean;
|
||||
private rewards: Array<{type: number, gid: number, count: number, times: number}>;
|
||||
private rewards: Array<{type: number, id: number, count: number, times: number}>;
|
||||
private fixReward: string;
|
||||
private conditionReward: string;
|
||||
private randomReward: string;
|
||||
@@ -106,8 +106,8 @@ export class WarReward {
|
||||
|
||||
let reward = decodeStr('randomReward', randomReward);
|
||||
for(let obj of reward) {
|
||||
let { gid, frequency } = obj;
|
||||
let dropHistory = await BattleDropModel.findByGid(this.roleId, this.battleId, gid);
|
||||
let { id, frequency } = obj;
|
||||
let dropHistory = await BattleDropModel.findByGid(this.roleId, this.battleId, id);
|
||||
let { getNum = 0, allNum = 0, getSum = 0, allSum = 0 } = dropHistory;
|
||||
for(let i = 0; i < num; i ++) {
|
||||
let flag = false; // 是否可以获得
|
||||
@@ -126,7 +126,7 @@ export class WarReward {
|
||||
this.rewards.push({type: BATTLE_REWARD_TYPE.RANDOM_REWARD, times: i +1, ...obj});
|
||||
}
|
||||
}
|
||||
await BattleDropModel.updateByGid(this.roleId, this.battleId, gid, {
|
||||
await BattleDropModel.updateByGid(this.roleId, this.battleId, id, {
|
||||
getNum, allNum, getSum, allSum
|
||||
});
|
||||
}
|
||||
@@ -179,7 +179,7 @@ export class WarReward {
|
||||
|
||||
const blueprtList = getBluePrtByQuality(id);
|
||||
const gid = getRandomByLen(blueprtList);
|
||||
return {gid, count:1}
|
||||
return {id: gid, count:1}
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user