underscore读取,排行榜保护

This commit is contained in:
mamengke01
2021-01-12 14:13:30 +08:00
parent 58f3e94fc0
commit 22f2eed34e
16 changed files with 53 additions and 51 deletions
+3 -3
View File
@@ -7,7 +7,7 @@ import { calPlayerCeAndSave } from "./playerCeService";
import { HERO_SYSTEM_TYPE } from "../consts";
import { EquipType } from "../db/Equip";
import { calEquipSeids } from '../pubUtils/playerCe';
const _ = require('underscore');
import { indexOf, findIndex } from 'underscore';
export function checkMaterialEnough(consumes:Array<{id: number, count: number}>, jewel: number, jewelCount: number) {
let comJewelMap = {};
consumes = mergeSameGoods(consumes);
@@ -51,7 +51,7 @@ export async function changeEquip(roleId: string, sid: string, equip: EquipType,
let { jobid } = gameData.hero.get(hid);
let { job_class } = getHeroJob(jobid);
let { classId } = getHeroEquipByClassId(goodInfo.itid);
if (_.indexOf(classId, job_class) < 0)
if (indexOf(classId, job_class) < 0)
return takeOffEquip(equip.seqId);
return dressEquip(roleId, sid, hero, equip);
} else {
@@ -63,7 +63,7 @@ export async function changeEquip(roleId: string, sid: string, equip: EquipType,
}
export async function takeOffEquipAndCalPlayerCe(roleId: string, sid: string, seqId: number, hero:HeroType, id: number ) {
let index = _.findIndex(hero.ePlace, { id });
let index = findIndex(hero.ePlace, { id });
if (index < 0)
return;
await EquipModel.updateEquipInfo(seqId, { hid: 0 });