From 321d9d15ba14c1941fce72ceb7a60f2fdfe8d915 Mon Sep 17 00:00:00 2001 From: luying Date: Sat, 18 Feb 2023 19:38:02 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E8=BF=9C=E5=BE=81):=20?= =?UTF-8?q?=E8=BF=9C=E5=BE=81=E8=BF=9B=E5=85=A5=E6=88=98=E5=9C=BA=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=95=8C=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/domain/roleField/attribute.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shared/domain/roleField/attribute.ts b/shared/domain/roleField/attribute.ts index 306e12ad7..731e04e97 100644 --- a/shared/domain/roleField/attribute.ts +++ b/shared/domain/roleField/attribute.ts @@ -30,11 +30,13 @@ export class AttributeCal { } } - public setByCeArr(attributes: {id: number, ceVal: number}[], ratio: number = 1) { - for(let {id, ceVal} of attributes) { + public setByCeArr(attributes: {id: number, val: number, ceVal: number}[], ratio: number = 1) { + for(let {id, val, ceVal} of attributes) { if(ABI_TYPE_MAIN.includes(id)) { + this.attrs.set(id, Math.floor(val * ratio)); this.ceAttrs.set(id, Math.floor(ceVal * ratio)); } else { + this.attrs.set(id, Math.floor(val * ratio)); this.ceAttrs.set(id, Math.floor(ceVal)); } }