镇念塔:修复派遣任务无奖励显示
This commit is contained in:
@@ -7,7 +7,7 @@ import { pushCalPlayerCe, pushCalAllHeroCe, calPlayerCeAndSave } from './playerC
|
||||
import { ItemModel } from '../db/Item';
|
||||
import { STATUS } from '../consts/statusCode';
|
||||
import { pinus } from 'pinus';
|
||||
import { addEquips, addBags, addSkin, addFigure, unlockFigure as pubUnlockFigure, createHeroes as pubCreateHeroes, transPiece } from '../pubUtils/itemUtils';
|
||||
import { addEquips, addBags, addSkin, addFigure, unlockFigure as pubUnlockFigure, createHeroes as pubCreateHeroes, transPiece, getGoldObject, getCoinObject, getApObject } from '../pubUtils/itemUtils';
|
||||
import { ItemInter, RewardInter, } from '../pubUtils/interface';
|
||||
import { gameData } from '../pubUtils/data';
|
||||
import { uniq } from 'underscore';
|
||||
@@ -147,6 +147,16 @@ export async function addItems(roleId: string, roleName: string, sid: string, go
|
||||
pinus.app.get('channelService').pushMessageByUids('onPlayerDataChange', resResult(STATUS.SUCCESS, {
|
||||
gold: role.gold, coin: role.coin, ap: addAp
|
||||
}), uids);
|
||||
if(gold.length > 0) {
|
||||
let goldCount = gold.reduce((pre, cur) => { return pre + cur.count }, 0)
|
||||
showItems.push(getGoldObject(goldCount));
|
||||
}
|
||||
if(coin > 0) {
|
||||
showItems.push(getCoinObject(coin));
|
||||
}
|
||||
if(ap > 0) {
|
||||
showItems.push(getApObject(ap));
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 皮肤处理
|
||||
@@ -158,7 +168,6 @@ export async function addItems(roleId: string, roleName: string, sid: string, go
|
||||
|
||||
for (let skinId of skins) {//皮肤推送
|
||||
let result = await addSkin(roleId, roleName, skinId, false);
|
||||
console.log(result)
|
||||
if (!!result) {
|
||||
showItems.push({ id: skinId, count: 1 });
|
||||
figureInfos.push(result.figureInfo);
|
||||
|
||||
Reference in New Issue
Block a user