From 50e1e98dafec4f2def3d37ee3e634724ed1687a5 Mon Sep 17 00:00:00 2001 From: luying Date: Wed, 23 Dec 2020 21:07:44 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=88=9D=E5=A7=8B=E6=AD=A6=E5=B0=86?= =?UTF-8?q?=E6=88=98=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/pubUtils/playerCe.ts | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/shared/pubUtils/playerCe.ts b/shared/pubUtils/playerCe.ts index e072bfe49..0ac39d55c 100644 --- a/shared/pubUtils/playerCe.ts +++ b/shared/pubUtils/playerCe.ts @@ -121,7 +121,28 @@ export function calHeroInitIncAttr(hero: HeroType, addSeidList: Array, r calHeroJobStageUpIncAttr(hero2, [0], addSeidList, removeSeidList); - return res2 + let result: CeAttr = {}; + combineAttrResult(result, res1); + combineAttrResult(result, res2); + + return res1 +} + +function combineAttrResult(target: CeAttr, origin: CeAttr) { + + for(let attrName in origin) { + for(let attrKey in origin[attrName]) { + if(!target.hasOwnProperty(attrName)) { + target[attrName] = {}; + } + if(!target[attrName].hasOwnProperty(attrKey)) { + target[attrName][attrKey] = 0; + } + if(origin[attrName][attrKey] > target[attrName][attrKey]) { + target[attrName][attrKey] = origin[attrName][attrKey]; + } + } + } } export function calRoleInitIncAttr(heros: HeroType[], globalCeAttr: CeAttr) {