From cf3607470fbbe14045e1a56475ad6addbb14b507 Mon Sep 17 00:00:00 2001 From: Rin Date: Mon, 18 Jul 2022 14:30:47 +0100 Subject: [PATCH] Fuck you typescript --- src/modules/game.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/modules/game.ts b/src/modules/game.ts index e5ec3d5..24d5408 100644 --- a/src/modules/game.ts +++ b/src/modules/game.ts @@ -27,15 +27,23 @@ export default class GameModule extends Module { let saveEx: any = {}; if (divcount !== null && divcount !== undefined) { saveEx.stClearDivCount = divcount; + } else { + saveEx.stClearDivCount = car!.stClearDivCount; } if (body.stResult!.stClearBits !== null && body.stResult!.stClearBits !== undefined) { saveEx.stClearBits = body.stResult!.stClearBits!; + } else { + saveEx.stClearBits = car!.stClearBits; } if (body.stResult!.stPlayCount !== null && body.stResult!.stPlayCount !== undefined) { saveEx.stPlayCount = body.stResult!.stPlayCount!; + } else { + saveEx.stPlayCount = car!.stPlayCount; } if (body.stResult!.stClearCount !== null && body.stResult!.stClearCount !== undefined) { saveEx.stClearCount = body.stResult!.stClearCount!; + } else { + saveEx.stClearCount = car!.stClearCount; } if (body.stResult!.stLoseBits !== null && body.stResult!.stLoseBits !== undefined) { let actualLoseBits = BigInt(0); @@ -45,15 +53,23 @@ export default class GameModule extends Module { actualLoseBits = actualLoseBits | BigInt(body.stResult!.stLoseBits.low); saveEx.stLoseBits = actualLoseBits; } + } else { + saveEx.stLoseBits = car!.stLoseBits; } if (body.stResult!.stConsecutiveWins !== null && body.stResult!.stConsecutiveWins !== undefined) { saveEx.stConsecutiveWins = body.stResult!.stConsecutiveWins!; + } else { + saveEx.stConsecutiveWins = car!.stConsecutiveWins; } if (body.stResult!.tuningPoint !== null && body.stResult!.tuningPoint !== undefined) { saveEx.tuningPoints = body.stResult!.tuningPoint!; + } else { + saveEx.tuningPoints = car!.tuningPoints; } if (body.stResult!.stCompleted_100Episodes !== null && body.stResult!.stCompleted_100Episodes !== undefined) { saveEx.stCompleted100Episodes = body.stResult!.stCompleted_100Episodes!; + } else { + saveEx.stCompleted100Episodes = car!.stCompleted100Episodes; } console.log(body); console.log(saveEx);