修复:诸侯混战宣战,邮件领取,名将谱去除好感,镇念塔层级下降,求贤若渴碎片,pvp,秘境首通

This commit is contained in:
luying
2022-01-06 20:55:01 +08:00
parent b744b7b560
commit a16ffd39ab
11 changed files with 151 additions and 153 deletions

View File

@@ -302,10 +302,12 @@ export async function addFigure(roleId: string, ids: number[], reason: number) {
* @param conditionId 条件id
*/
function unlockSingleFigure(dbFigures: Figure[], id: number, reason: number, unlockDirect = false, conditionId?: number) {
let figure = dbFigures.find(cur => cur.id == id);
if (!figure) {
let index = dbFigures.findIndex(cur => cur.id == id);
let figure = dbFigures[index];
if (index == -1) {
figure = new Figure(id, false);
dbFigures.push(figure);
index = dbFigures.length - 1;
}
if (figure.unlocked) return; // 已解锁过
if (!figure.unlockedId) figure.unlockedId = new Array<number>();
@@ -335,6 +337,7 @@ function unlockSingleFigure(dbFigures: Figure[], id: number, reason: number, unl
figure.inc = 1;
figure.reason = reason;
dbFigures[index] = figure;
return figure
}