From 2b809c80162af034b9cf8678817c5b6676aae34c Mon Sep 17 00:00:00 2001 From: luying Date: Thu, 11 Nov 2021 18:05:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=98=E6=96=97=EF=BC=9A=E6=98=9F=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/normalBattleService.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/game-server/app/services/normalBattleService.ts b/game-server/app/services/normalBattleService.ts index 167ed77e2..d66476124 100644 --- a/game-server/app/services/normalBattleService.ts +++ b/game-server/app/services/normalBattleService.ts @@ -122,7 +122,8 @@ export function calculateWarStar(warStar: WarStar[] = [], battleId: number, star let hasFound = false; for(let curWarStar of warStar) { if(curWarStar.id == battleId) { - newStars = uniq([...stars, ...curWarStar.stars]); + let oldStars = curWarStar.stars||[]; + newStars = uniq([...stars, ...oldStars]); newStar = newStars.filter(cur => cur > 0).length; newWarStars.push({...curWarStar, star: newStar, stars: newStars}); hasFound = true;