fix: don't set rank_exp_change if isUdemaeUp is true

should fix #17

0.1.19
main
spacemeowx2 2022-11-10 21:04:08 +08:00
parent e77ad9f152
commit 43df6baaea
3 changed files with 11 additions and 3 deletions

View File

@ -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

View File

@ -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";

View File

@ -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;
}