underscore读取,排行榜保护
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user