Skip to content

Commit

Permalink
Add missing dynamic cast assertions in ScreenGameplayPractice
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed May 29, 2022
1 parent 8d34d3d commit e688a36
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Etterna/Screen/Gameplay/ScreenGameplayPractice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ ScreenGameplayPractice::Update(const float fDeltaTime)

// Reset the wife/judge counter related visible stuff
auto* pl = dynamic_cast<PlayerPractice*>(m_vPlayerInfo.m_pPlayer);
ASSERT_M(pl != nullptr,
"Dynamic cast in ScreenGameplayPractice::Update failed.");
pl->PositionReset();
}
lastReportedSeconds = GAMESTATE->m_Position.m_fMusicSeconds;
Expand Down Expand Up @@ -415,6 +417,8 @@ ScreenGameplayPractice::SetSongPosition(float newSongPositionSeconds,

// Reset the wife/judge counter related visible stuff
auto* pl = dynamic_cast<PlayerPractice*>(m_vPlayerInfo.m_pPlayer);
ASSERT_M(pl != nullptr,
"Dynamic cast in ScreenGameplayPractice::SetSongPosition failed.");
pl->RenderAllNotesIgnoreScores();
pl->PositionReset();

Expand Down

0 comments on commit e688a36

Please sign in to comment.