From 43df6baaea481021355a315d01eb1945d00f8c52 Mon Sep 17 00:00:00 2001 From: spacemeowx2 Date: Thu, 10 Nov 2022 21:04:08 +0800 Subject: [PATCH] fix: don't set rank_exp_change if isUdemaeUp is true should fix #17 0.1.19 --- CHANGELOG | 4 ++++ src/constant.ts | 2 +- src/exporters/stat.ink.ts | 8 ++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3ab2236..432a2da 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +## 0.1.19 + +fix: don't set rank_exp_change if isUdemaeUp is true + ## 0.1.18 feat: remove gear map workaround diff --git a/src/constant.ts b/src/constant.ts index d550123..16017ca 100644 --- a/src/constant.ts +++ b/src/constant.ts @@ -1,7 +1,7 @@ import type { StatInkPostBody, VsHistoryDetail } from "./types.ts"; export const AGENT_NAME = "s3si.ts"; -export const S3SI_VERSION = "0.1.18"; +export const S3SI_VERSION = "0.1.19"; export const NSOAPP_VERSION = "2.3.1"; export const WEB_VIEW_VERSION = "1.0.0-5644e7a2"; export const S3SI_LINK = "https://github.com/spacemeowx2/s3si.ts"; diff --git a/src/exporters/stat.ink.ts b/src/exporters/stat.ink.ts index c1e2de9..dced098 100644 --- a/src/exporters/stat.ink.ts +++ b/src/exporters/stat.ink.ts @@ -358,8 +358,12 @@ export class StatInkExporter implements GameExporter { result.rank_before_exp = rankBeforeState.rankPoint; result.rank_after_exp = rankState.rankPoint; - // splatnet returns null, so we need to calculate it - if (result.rank_exp_change === undefined) { + // splatnet returns null, so we need to calculate it. + // don't calculate if it's a promotion battle. + if ( + !bankaraMatchChallenge?.isUdemaeUp && + result.rank_exp_change === undefined + ) { result.rank_exp_change = result.rank_after_exp - result.rank_before_exp; }