道具使用:添加返回
This commit is contained in:
@@ -93,33 +93,20 @@ export function getCoinEventProperties(inc: number, count: number, reason: ITEM_
|
||||
return { item_id: id, item_name: dicGoods.name, item_itid: dicGoods.itid, change_count: inc, change_after: count, change_reason: reason }
|
||||
}
|
||||
|
||||
export function combineItems(items: { id?: number, count?: number }[]) {
|
||||
let result: { id: number, count: number }[] = [];
|
||||
for(let { id, count = 1 } of items) {
|
||||
let index = result.findIndex(cur => cur.id == id);
|
||||
if(index == -1) {
|
||||
result.push({ id, count });
|
||||
} else {
|
||||
result[index].count += count;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export function combineItemAndJewels(items: { id?: number, count?: number }[]) {
|
||||
let result: { id: number, count: number }[] = [];
|
||||
for(let { id, count = 1 } of items) {
|
||||
export function combineItems(items: { id?: number, count?: number, seqId?: number, isBag?: boolean }[]) {
|
||||
let result: { id: number, count: number, seqId?: number, isBag?: boolean }[] = [];
|
||||
for(let { id, count = 1, seqId, isBag } of items) {
|
||||
let dicGoods = gameData.goods.get(id);
|
||||
let dicItid = ITID.get(dicGoods.itid);
|
||||
if(dicItid.table != 'jewel') {
|
||||
let index = result.findIndex(cur => cur.id == id);
|
||||
if(index == -1) {
|
||||
result.push({ id, count });
|
||||
result.push({ id, count, seqId, isBag });
|
||||
} else {
|
||||
result[index].count += count;
|
||||
}
|
||||
} else {
|
||||
result.push({ id, count });
|
||||
result.push({ id, count, seqId, isBag });
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user