json:fix数组重复加载的bug

This commit is contained in:
luying
2021-06-07 09:54:07 +08:00
parent fe73748cd7
commit c2436c85a8
17 changed files with 17 additions and 10 deletions
+1
View File
@@ -38,6 +38,7 @@ const DicHeroKeys: KeysEnum<DicHero> = {heroId: true, name: true, quality: true,
export const dicMyHeroes = new Array<number>();
export const dicHero = new Map<number, DicHero>();
export function loadHero() {
dicMyHeroes.splice(0, dicMyHeroes.length);
let arr = readFileAndParse(FILENAME.DIC_HERO);
arr.forEach(o => {
if(o.heroId > 0 && o.heroId <= 300) {