From 1875b36c0288dc70c38807ca77d32fbecd009ea3 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 31 Aug 2004 08:37:47 +0000 Subject: [PATCH] fix "use edits to get 100% chance of a locked song when choosing Random" --- stepmania/src/MusicWheel.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/stepmania/src/MusicWheel.cpp b/stepmania/src/MusicWheel.cpp index ef6e02f8b5..403d40fbac 100644 --- a/stepmania/src/MusicWheel.cpp +++ b/stepmania/src/MusicWheel.cpp @@ -1531,8 +1531,19 @@ int MusicWheel::GetPreferredSelectionForRandomOrPortal() // difficulties of each player vector vDifficultiesToRequire; FOREACH_HumanPlayer(p) - if( GAMESTATE->m_PreferredDifficulty[p] != DIFFICULTY_INVALID ) - vDifficultiesToRequire.push_back( GAMESTATE->m_PreferredDifficulty[p] ); + { + if( GAMESTATE->m_PreferredDifficulty[p] == DIFFICULTY_INVALID ) + continue; // skip + + // TRICKY: Don't require that edits be present if perferred + // difficulty is DIFFICULTY_EDIT. Otherwise, players could use this + // to set up a 100% chance of getting a particular locked song by + // having a single edit for a locked song. + if( GAMESTATE->m_PreferredDifficulty[p] == DIFFICULTY_EDIT ) + continue; // skip + + vDifficultiesToRequire.push_back( GAMESTATE->m_PreferredDifficulty[p] ); + } StepsType st = GAMESTATE->GetCurrentStyle()->m_StepsType;