Skip to content

Commit 10da38e

Browse files
replace fail condition in selectcurrent with simple return
forced crashes as a result of this are infrequent and not reproducible to my knowledge granted this condition should never occur, however i don't understand the practical necessity to force crash the game rather than just ignoring the command it's possible there could be an issue not found when testing this and we can revisit this change if that is the case
1 parent 660e45f commit 10da38e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/ScreenSelectMusic.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,10 @@ bool ScreenSelectMusic::SelectCurrent(PlayerNumber pn)
12231223

12241224
switch (m_SelectionState)
12251225
{
1226-
DEFAULT_FAIL(m_SelectionState);
1226+
case SelectionState_Finalized: {
1227+
LOG->Warn("song selection made while selectionstate_finalized");
1228+
return false;
1229+
}
12271230
case SelectionState_SelectingSong:
12281231
// If false, we don't have a selection just yet.
12291232
if (!m_MusicWheel.Select())

src/ScreenSelectMusic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ class ScreenSelectMusic : public ScreenWithMenuElements
117117
return TWO_PART_SELECTION ? SelectionState_SelectingSteps : SelectionState_Finalized;
118118
case SelectionState_SelectingSteps:
119119
return SelectionState_Finalized;
120-
DEFAULT_FAIL( m_SelectionState );
120+
case SelectionState_Finalized:
121+
return SelectionState_Finalized;
121122
}
122123
}
123124

0 commit comments

Comments
 (0)