Skip to content

Commit

Permalink
fix: check for empty value in ruleset_addr & print error correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
486c committed Jan 5, 2024
1 parent cbbb66b commit 0179ecd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/reading_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ pub fn process_gameplay(

values.prev_playtime = values.playtime;

if ruleset_addr == 0 {
return Ok(())
};

let gameplay_base =
p.read_i32((ruleset_addr + 0x68) as usize)? as usize;

Expand Down Expand Up @@ -299,6 +303,7 @@ pub fn process_reading_loop(
}

values.update_stars_and_ss_pp();
values.update_current_pp(&mut state.ivalues);
}

let ruleset_addr = p.read_i32(
Expand Down Expand Up @@ -342,8 +347,8 @@ pub fn process_reading_loop(
ruleset_addr
);

if res.is_err() {
println!("{:?}", res);
if let Err(e) = res {
println!("{:?}", e);
println!("Skipped gameplay reading, probably it's not ready yet");
}
}
Expand Down

0 comments on commit 0179ecd

Please sign in to comment.