Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pistonight committed Aug 11, 2024
1 parent b7dd0d4 commit a34738e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/core/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ void State::write_to_game(Reporter& r, const StateConfig& config, bool hold) con
r.report("CamTilt", raw_ptr::camera_tilt().set(m_camera_tilt));

// extras
r.report("RdBombCD", raw_ptr::round_bomb_cooldown().set(0.0F));
r.report("SqBombCD", raw_ptr::square_bomb_cooldown().set(0.0F));
r.report("RdBombCD", raw_ptr::round_bomb_cooldown().set(360.0F));
r.report("SqBombCD", raw_ptr::square_bomb_cooldown().set(360.0F));
r.report("StasisCD", raw_ptr::stasis_cooldown().set(0.0F));

auto* proc_mgr = ksys::act::BaseProcMgr::instance();
Expand Down
5 changes: 4 additions & 1 deletion src/core/worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ void Worker::do_work() {
Reporter reporter;
get_last_restored_state().write_to_game(reporter, m_config, true);
// we don't report here to reduce spam
// restore every 2 frames so the game has a chance to update
nn::os::YieldThread();
nn::os::SleepThread(nn::TimeSpan::FromNanoSeconds(60 * 1000 * 1000));
}
break;
case Command::RestoreDone:
Expand Down Expand Up @@ -249,8 +252,8 @@ void Worker::welcome() {
return;
}
if (m_pos_diff_ticks > 0) {
// y is not checked because of elevator cutscene
if (std::abs(new_pos[0] - m_player_pos[0]) < 0.0001F ||
std::abs(new_pos[1] - m_player_pos[1]) < 0.0001F ||
std::abs(new_pos[2] - m_player_pos[2]) < 0.0001F) {
m_pos_diff_ticks = 0;
return;
Expand Down

0 comments on commit a34738e

Please sign in to comment.