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
+2 -2
View File
@@ -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);