Skip to content

Commit

Permalink
properly load/store fail preference when turning on/off practice mode
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed May 19, 2019
1 parent c16a0f5 commit 6271e50
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
22 changes: 12 additions & 10 deletions src/Etterna/Screen/Gameplay/ScreenGameplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,16 +347,6 @@ ScreenGameplay::Init()
GAMESTATE->SetPaused(false);
m_fReplayBookmarkSeconds = 0.f;

// Force FailOff in Practice Mode
if (GAMESTATE->m_pPlayerState->m_PlayerOptions.GetCurrent().m_bPractice) {
GAMESTATE->m_pPlayerState->m_PlayerOptions.GetCurrent().m_FailType =
FailType_Off;
GAMESTATE->m_pPlayerState->m_PlayerOptions.GetSong().m_FailType =
FailType_Off;
GAMESTATE->m_pPlayerState->m_PlayerOptions.GetPreferred().m_FailType =
FailType_Off;
}

int player = 1;
FOREACH_EnabledPlayerInfo(m_vPlayerInfo, pi)
{
Expand Down Expand Up @@ -604,6 +594,18 @@ ScreenGameplay::Init()
m_gave_up = false;
m_skipped_song = false;

// Force FailOff in Practice Mode
if (GAMESTATE->m_pPlayerState->m_PlayerOptions.GetCurrent().m_bPractice) {
GAMEMAN->m_iPreviousFail =
GAMESTATE->m_pPlayerState->m_PlayerOptions.GetPreferred().m_FailType;
GAMESTATE->m_pPlayerState->m_PlayerOptions.GetCurrent().m_FailType =
FailType_Off;
GAMESTATE->m_pPlayerState->m_PlayerOptions.GetSong().m_FailType =
FailType_Off;
GAMESTATE->m_pPlayerState->m_PlayerOptions.GetPreferred().m_FailType =
FailType_Off;
}

if (!GAMEMAN->m_bRestartedGameplay &&
GAMESTATE->m_pPlayerState->m_PlayerOptions.GetCurrent().m_bPractice) {
GAMEMAN->m_bResetModifiers = true;
Expand Down
8 changes: 4 additions & 4 deletions src/Etterna/Screen/Others/ScreenSelectMusic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ ScreenSelectMusic::Init()
->m_PlayerOptions.GetCurrent()
.m_bPractice) {
GAMESTATE->m_pPlayerState
->m_PlayerOptions.GetPreferred()
.m_FailType = FailType_Immediate;
->m_PlayerOptions.GetPreferred().m_FailType =
GAMEMAN->m_iPreviousFail;
GAMESTATE->m_pPlayerState
->m_PlayerOptions.GetSong()
.m_FailType = FailType_Immediate;
.m_FailType = GAMEMAN->m_iPreviousFail;
GAMESTATE->m_pPlayerState
->m_PlayerOptions.GetCurrent()
.m_FailType = FailType_Immediate;
.m_FailType = GAMEMAN->m_iPreviousFail;
}

IDLE_COMMENT_SECONDS.Load(m_sName, "IdleCommentSeconds");
Expand Down

0 comments on commit 6271e50

Please sign in to comment.