修复当出现相同关卡id时记录会混乱的bug
This commit is contained in:
@@ -234,7 +234,14 @@ export async function refreshEvent(num: number, roleId: string, roleName: string
|
||||
let curPoint = new Array<number>();
|
||||
for(let i = 0; i < num; i++) {
|
||||
let {dic} = getRandomWithWeight(randomList);
|
||||
console.log(JSON.stringify(dic))
|
||||
// 临时处理,不出现相同的关卡id
|
||||
for(let x = 0; x < 1000; x++) {
|
||||
let hasEvent = event.find(cur => {
|
||||
return cur.type == EVENT_TYPE.BATTLE && cur.battleId == dic.warId});
|
||||
dic = getRandomWithWeight(randomList).dic;
|
||||
if(!hasEvent) break;
|
||||
}
|
||||
|
||||
// if(!dic) break;
|
||||
let point = randomPosition(dic.movePointArray, prePoint, curPoint);
|
||||
let eventCode = genCode(8);
|
||||
|
||||
Reference in New Issue
Block a user