Skip to content

Commit

Permalink
fix: trying to read player on result screen
Browse files Browse the repository at this point in the history
  • Loading branch information
xxCherry committed Oct 20, 2024
1 parent f7376b1 commit 5350c5e
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions packages/tosu/src/memory/lazer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,19 +539,25 @@ export class LazerMemory extends AbstractMemory<LazerPatternData> {
if (username === 'osu!salad') username = 'salad!';
if (username === 'osu!topus') username = 'osu!topus!';

let pp = 0;

const player = this.player();
const scoreProcessor = this.process.readIntPtr(player + 0x438);
if (player) {
const scoreProcessor = this.process.readIntPtr(player + 0x438);

const hudOverlay = this.process.readIntPtr(player + 0x450);
const mainComponents = this.readComponents(
this.process.readIntPtr(hudOverlay + 0x3b8)
);
const hudOverlay = this.process.readIntPtr(player + 0x450);
const mainComponents = this.readComponents(
this.process.readIntPtr(hudOverlay + 0x3b8)
);

const ppCounter = this.findPPCounter(mainComponents, scoreProcessor);
let pp = 0;
const ppCounter = this.findPPCounter(
mainComponents,
scoreProcessor
);

if (ppCounter) {
pp = this.process.readInt(ppCounter + 0x324);
if (ppCounter) {
pp = this.process.readInt(ppCounter + 0x324);
}
}

return {
Expand Down Expand Up @@ -592,9 +598,7 @@ export class LazerMemory extends AbstractMemory<LazerPatternData> {

const statistics = this.process.readIntPtr(user + 0xa8);

const pp = this.process.readBuffer(statistics + 0x60, 1 + 4 + 4 + 8);

console.log(pp.toString('hex'));
// const pp = this.process.readBuffer(statistics + 0x60, 1 + 4 + 4 + 8);

// const gamemode = this.process.readInt(rulesetInfo + 0x30);

Expand Down

0 comments on commit 5350c5e

Please sign in to comment.