underscore读取,排行榜保护
This commit is contained in:
@@ -14,7 +14,7 @@ import { EQUIP } from "../../../pubUtils/dicParam";
|
||||
import { ITID, SPEICAL_ITEM, RANDOM_SE_COUNT } from "../../../consts/constModules/itemConst";
|
||||
import { changeEquip, dressEquip, checkMaterialEnough, takeOffEquipAndCalPlayerCe } from "../../../services/equipService";
|
||||
|
||||
const _ = require('underscore');
|
||||
import { indexOf, findIndex } from 'underscore';
|
||||
|
||||
export default function (app: Application) {
|
||||
return new EquipHandler(app);
|
||||
@@ -433,9 +433,9 @@ export class EquipHandler {
|
||||
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 resResult(STATUS.EQUIP_NOT_EQUIPED_HERO);
|
||||
let index = _.findIndex(hero.ePlace, { id });
|
||||
let index = findIndex(hero.ePlace, { id });
|
||||
if (index < 0)
|
||||
return resResult(STATUS.WRONG_PARMS);
|
||||
let equipOffInfo = <EquipType>hero.ePlace[index].equip;
|
||||
@@ -460,7 +460,7 @@ export class EquipHandler {
|
||||
let roleId: string = session.get('roleId');
|
||||
let sid: string = session.get('sid');
|
||||
let equip = await EquipModel.getEquip(eid);
|
||||
let index = _.findIndex(equip.holes, { id });
|
||||
let index = findIndex(equip.holes, { id });
|
||||
if (index < 0)
|
||||
return resResult(STATUS.EQUIP_HOLE_NOT_FIND);
|
||||
if (equip.holes[index].isOpen)
|
||||
@@ -494,7 +494,7 @@ export class EquipHandler {
|
||||
let jewelInfo = getGoodById(jewel);
|
||||
if (jewelInfo.itid != equipJewel)
|
||||
return resResult(STATUS.EQUIP_NOT_MATCH_JEWEL);
|
||||
let index = _.findIndex(equip.holes, { id });
|
||||
let index = findIndex(equip.holes, { id });
|
||||
if (index < 0)
|
||||
return resResult(STATUS.EQUIP_HOLE_NOT_FIND);
|
||||
if (!equip.holes[index].isOpen)
|
||||
@@ -549,7 +549,7 @@ export class EquipHandler {
|
||||
let sid: string = session.get('sid');
|
||||
let goods: Array<{ id: number, count: number }> = [];
|
||||
let equip = await EquipModel.getEquip(eid);
|
||||
let index = _.findIndex(equip.holes, { id });
|
||||
let index = findIndex(equip.holes, { id });
|
||||
if (index > 0)
|
||||
return resResult(STATUS.EQUIP_HOLE_NOT_FIND);
|
||||
let jewel = equip.holes[index].jewel;
|
||||
@@ -623,7 +623,7 @@ export class EquipHandler {
|
||||
let equip;
|
||||
if (!!eid) {
|
||||
equip = await EquipModel.getEquip(eid);
|
||||
let index = _.findIndex(equip.holes,{id});
|
||||
let index = findIndex(equip.holes,{id});
|
||||
if (!!equip.holes[index] && equip.holes[index].jewel == goodInfo.composeMaterial[0].id) {
|
||||
oldJewel = equip.holes[index].jewel;
|
||||
equip.holes[index].jewel = jewel;
|
||||
|
||||
Reference in New Issue
Block a user