fix(学宫): 修复图鉴统计数量
This commit is contained in:
@@ -186,10 +186,10 @@ export function formateCharasOrCards(params: RougelikeCharaPara[] | RougelikeCar
|
||||
export async function addCollection(roleId: string, sid: string, gameCode: string, arr: { type: number, id: number, addNum?: number }[]) {
|
||||
let collections: { type: number, id: number, num: number }[] = [], passiveCnt = 0;
|
||||
for (let { type, id, addNum = 1 } of arr) {
|
||||
if (type == COLLECTION_TYPE.PASSIVE_CARD_SUM) continue;
|
||||
if (type == COLLECTION_TYPE.PASSIVE_CARD_SUM || id == 0) continue;
|
||||
let collection = await RougelikeCollectionModel.addRec(roleId, type, id, gameCode, addNum);
|
||||
if (!collection || collection.num > 1) continue;
|
||||
if (collection.num == 1) passiveCnt++;
|
||||
if (type == COLLECTION_TYPE.PASSIVE_CARD && collection.num == 1) passiveCnt++;
|
||||
collections.push({ type, id, num: collection.num });
|
||||
}
|
||||
if (passiveCnt > 0) {
|
||||
|
||||
Reference in New Issue
Block a user