掉落装备传参修改
This commit is contained in:
@@ -124,13 +124,13 @@ async function rewardCurrency (roleId: string, dicGood: any, data: {id:number,cn
|
||||
});
|
||||
return goods;
|
||||
}
|
||||
interface Item {id: number, count: number, seqId?: number};
|
||||
interface Item {id?: number, count?: number, seqId?: number, type?: number};
|
||||
interface Equip {id: number, name: string, quality: number, type: number};
|
||||
interface Bag {id: number, itemName: string, count: number, type: number, hid:number};
|
||||
export async function handleCost(roleId: string, sid: string, goods: Array<Item>) {
|
||||
let currencysMap: any = {};
|
||||
let equips: Array<number> = [];
|
||||
let bags: Array<Item> = [];
|
||||
let bags: Array<{id: number, count: number}> = [];
|
||||
let uids = [{uid: roleId, sid}];
|
||||
if (!sortConsumes(goods, bags, currencysMap, equips))
|
||||
return false;
|
||||
@@ -174,14 +174,14 @@ export async function handleCost(roleId: string, sid: string, goods: Array<Item>
|
||||
|
||||
function sortConsumes(goods: Array<Item>, bags: Array<Item>, currencysMap: any, equips: Array<number>) {
|
||||
for (let good of goods) {
|
||||
let goodInfo = getGoodById(good.id);
|
||||
if (goodInfo.goodType == GOOD_TYPE.EQUIP) { // 装备
|
||||
if (good.type == GOOD_TYPE.EQUIP) { // 装备
|
||||
if (!!good.seqId) {
|
||||
equips.push(good.seqId);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
let goodInfo = getGoodById(good.id);
|
||||
let {type} = ITID.get(goodInfo.itid);
|
||||
let curname = getCurNameById(goodInfo.good_id);
|
||||
if (!!curname) {
|
||||
|
||||
Reference in New Issue
Block a user