From 7d2f791a4202a32013a227dde65d10abae696ab5 Mon Sep 17 00:00:00 2001 From: storycraft Date: Sat, 25 Jul 2026 20:12:52 +0900 Subject: [PATCH] fix: add scorev2 mod on multi --- packages/tosu/src/memory/stable.ts | 17 +++++++++++++---- packages/tosu/src/utils/osuMods.types.ts | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/tosu/src/memory/stable.ts b/packages/tosu/src/memory/stable.ts index 8ebb4dc0..59fe2cb0 100644 --- a/packages/tosu/src/memory/stable.ts +++ b/packages/tosu/src/memory/stable.ts @@ -39,6 +39,7 @@ import { calculateAccuracy } from '@/utils/calculators'; import { netDateBinaryToDate } from '@/utils/converters'; import { fromLegacyHitResults } from '@/utils/hitResult'; import { calculateMods, defaultCalculatedMods } from '@/utils/osuMods'; +import { OsuMods } from '@/utils/osuMods.types'; import type { BindingsList, ConfigList, @@ -544,18 +545,26 @@ export class StableMemory extends AbstractMemory { const playerName = this.process.readSharpString( this.process.readInt(scoreBase + 0x28) ); + + // [[Ruleset + 0x64] + 0x38] + 0x64 + const mode = this.process.readInt(scoreBase + 0x64); + + const scoreProcessor = this.process.readInt(scoreBase + 0x54); + // [[[Ruleset + 0x64] + 0x38] + 0x1C] + 0xC ^ [[[Ruleset + 0x64] + 0x38] + 0x1C] + 0x8 - const modsInt = + let modsInt = this.process.readInt( this.process.readInt(scoreBase + 0x1c) + 0xc ) ^ this.process.readInt( this.process.readInt(scoreBase + 0x1c) + 0x8 ); - // [[Ruleset + 0x64] + 0x38] + 0x64 - const mode = this.process.readInt(scoreBase + 0x64); - const scoreProcessor = this.process.readInt(scoreBase + 0x54); + // Scorev2 is not on mods if it's specified as a win condition. + if (scoreProcessor !== 0) { + modsInt |= OsuMods.ScoreV2; + } + const score = scoreProcessor === 0 ? this.process.readInt(scoreBase + 0x78) // v1 diff --git a/packages/tosu/src/utils/osuMods.types.ts b/packages/tosu/src/utils/osuMods.types.ts index 57d21e05..f3d5ce37 100644 --- a/packages/tosu/src/utils/osuMods.types.ts +++ b/packages/tosu/src/utils/osuMods.types.ts @@ -278,7 +278,7 @@ export enum OsuMods { Key1 = 1 << 26, Key3 = 1 << 27, Key2 = 1 << 28, - LastMod = 1 << 29, + ScoreV2 = 1 << 29, keyMod = Key1 | Key2 | Key3 |