装备替换
This commit is contained in:
@@ -422,7 +422,7 @@ export class EquipHandler {
|
||||
let obj = ITID.get(goodInfo.itid);
|
||||
let id = obj.type;
|
||||
let curEquips: Array<{ seqId: number, hid: number}> = [];
|
||||
let hero = await HeroModel.getHeroEquip(roleId, hid);
|
||||
let hero = await HeroModel.findByHidAndRoleWithEquip(hid, roleId);
|
||||
if (!hero)
|
||||
return resResult(STATUS.HERO_NOT_FIND);
|
||||
if (type == 1) {
|
||||
|
||||
@@ -42,7 +42,7 @@ export function checkMaterialEnough(consumes:Array<{id: number, count: number}>,
|
||||
export async function changeEquip(roleId: string, sid: string, equip: EquipType, hid: number, id: number, seqId: number) {
|
||||
let hero;
|
||||
if (!!hid) //需要卸下或者替换的武将
|
||||
hero = await HeroModel.findByHidAndRole(hid, roleId);
|
||||
hero = await HeroModel.findByHidAndRoleWithEquip(hid, roleId);
|
||||
if (!!equip) {//需要卸下的装备
|
||||
if (!!hero) {//判断是否替换装备
|
||||
let goodInfo = getGoodById(equip.id);
|
||||
|
||||
Reference in New Issue
Block a user