From fd3e42d77de6312b697cd63d7ba94e7b55264b58 Mon Sep 17 00:00:00 2001 From: luying Date: Mon, 1 Nov 2021 09:49:56 +0800 Subject: [PATCH] =?UTF-8?q?jenkins=EF=BC=9A=E4=BF=AE=E5=A4=8D=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=B8=8D=E9=80=9A=E8=BF=87bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/pvpService.ts | 2 +- shared/domain/dbGeneral.ts | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/game-server/app/services/pvpService.ts b/game-server/app/services/pvpService.ts index d314aded9..9cb913f8c 100644 --- a/game-server/app/services/pvpService.ts +++ b/game-server/app/services/pvpService.ts @@ -240,7 +240,7 @@ async function matchRobot(oppPlayers: OppPlayer[], role: RoleType, score: number if (!dicHero) continue; let heroInfo = new PvpHeroInfo(); let { attribute, ce, lv } = getRobotAttribute(actorId, ratio, score); - heroInfo.setRobotInfo(actorId, lv); + heroInfo.setRobotInfo(dicHero, lv); defCe += ce; heroInfo.setAttribute(attribute); let enemy = new PvpEnemies(h, heroInfo, 0, ce); diff --git a/shared/domain/dbGeneral.ts b/shared/domain/dbGeneral.ts index 58b9924ca..03d418f37 100644 --- a/shared/domain/dbGeneral.ts +++ b/shared/domain/dbGeneral.ts @@ -2,7 +2,7 @@ import { prop, mongoose, Ref } from '@typegoose/typegoose'; import { DicWarJson } from '../pubUtils/dictionary/DicWarJson'; import Hero, { HeroType } from '../db/Hero'; import { nowSeconds } from '../pubUtils/timeUtil'; -import { gameData } from '../pubUtils/data'; +import { DicHero } from '../pubUtils/dictionary/DicHero'; // 从玩家数据中覆盖warjson的部分字段 export class PvpHeroInfo { @@ -42,10 +42,9 @@ export class PvpHeroInfo { this.quality = hero.quality; } - setRobotInfo(actorId: number, lv: number) { - let dicHero = gameData.hero.get(actorId); - this.actorId = actorId; - this.skinId = actorId; + setRobotInfo(dicHero: DicHero, lv: number) { + this.actorId = dicHero.heroId; + this.skinId = dicHero.heroId; this.actorName = dicHero.name; this.star = dicHero.initialStars; this.lv = lv;