Skip to content

Commit 3e211cd

Browse files
committed
oops fix song offset again
1 parent 7f03f33 commit 3e211cd

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/hooks.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,4 +255,6 @@ void Hooks::init() {
255255
add_hook<&PlayerObject_ringJump>(gd::base + 0x1f4ff0);
256256
add_hook<&GameObject_activateObject>(gd::base + 0xef0e0);
257257
add_hook<&GJBaseGameLayer_bumpPlayer>(gd::base + 0x10ed50);
258+
259+
add_hook<&PlayLayer_init>(gd::base + 0x1FB780);
258260
}

src/recorder.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ void Recorder::handle_recording(gd::PlayLayer* play_layer, float dt) {
182182
}
183183

184184
void Recorder::update_song_offset(gd::PlayLayer* play_layer) {
185-
// from what i've checked rob doesnt store this anywhere, so i have to calculate it again
186-
if (m_recording)
187-
m_song_start_offset = play_layer->timeForXPos2(
188-
play_layer->m_player1->m_position.x, play_layer->m_isTestMode) + play_layer->m_levelSettings->m_songStartOffset;
185+
// from what i've checked rob doesnt store the timeforxpos result anywhere, so i have to calculate it again
186+
m_song_start_offset = play_layer->m_levelSettings->m_songStartOffset + play_layer->timeForXPos2(
187+
play_layer->m_player1->m_position.x, play_layer->m_isTestMode);
189188
}

0 commit comments

Comments
 (0)