任务:修复装备穿戴bug

This commit is contained in:
luying
2022-01-04 14:22:47 +08:00
parent 6ce57740cf
commit 59f3f5c07d
4 changed files with 14 additions and 8 deletions
+2 -1
View File
@@ -137,13 +137,14 @@ export async function handleCost(roleId: string, sid: string, goods: Array<ItemI
}
}
for(let [_hid, {hero, equips} ] of heroMap) {
let oldCount = hero.ePlace.filter(cur => cur.equip).length;
let args = calEquipSeids(hero);
for(let equip of equips) {
hero = await HeroModel.removeEquip(roleId, hero.hid, equip.ePlaceId, equip._id);
}
await calPlayerCeAndSave(HERO_SYSTEM_TYPE.EQUIP, sid, roleId, hero, {}, args);
await checkTaskWithHero(roleId, sid, TASK_TYPE.EQUIP_BY_HERO, hero, [-1]);
await checkTaskWithHero(roleId, sid, TASK_TYPE.EQUIP_BY_HERO, hero, [-1, oldCount]);
}