From a34738ec36c2b941cdcb9fcc663986f5fc6dd075 Mon Sep 17 00:00:00 2001 From: Pistonight Date: Sun, 11 Aug 2024 14:10:57 -0700 Subject: [PATCH] bug fixes --- src/core/state.cpp | 4 ++-- src/core/worker.cpp | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/state.cpp b/src/core/state.cpp index ed21e06..8daa9b7 100644 --- a/src/core/state.cpp +++ b/src/core/state.cpp @@ -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(); diff --git a/src/core/worker.cpp b/src/core/worker.cpp index c242767..ef734af 100644 --- a/src/core/worker.cpp +++ b/src/core/worker.cpp @@ -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: @@ -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;