underscore读取,排行榜保护
This commit is contained in:
@@ -8,7 +8,7 @@ import { gameData } from './data';
|
||||
import { RANDOM_SE_COUNT, FIX_ATTRIBUTES_RAN, ITID } from '../consts';
|
||||
import { getRandValueByMinMax, getRandEelm } from './util';
|
||||
|
||||
const _ = require('underscore');
|
||||
import { findWhere } from 'underscore';
|
||||
|
||||
export async function addSkins(roleId: string, id: number) {
|
||||
let skinInfo = gameData.fashion.get(id);
|
||||
@@ -17,7 +17,7 @@ export async function addSkins(roleId: string, id: number) {
|
||||
let hero = await HeroModel.findByHidAndRole(skinInfo.actorId, roleId);
|
||||
if (!hero)
|
||||
return false;
|
||||
if (!!_.findWhere(hero.skins, { id }))
|
||||
if (!!findWhere(hero.skins, { id }))
|
||||
return false;
|
||||
hero.skins.push({ id, enable: false });
|
||||
await HeroModel.updateHeroInfo(roleId, hero.hid, hero);
|
||||
|
||||
Reference in New Issue
Block a user