From cf4f6c35a0d12cd1978c11c4e96c7f8451e5cd84 Mon Sep 17 00:00:00 2001 From: "Ben \"root\" Anderson" Date: Mon, 25 Nov 2013 21:54:41 -0600 Subject: [PATCH] Don't let duplicates happen! --- src/GameManager.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/GameManager.cpp b/src/GameManager.cpp index 431d4332ff..56ec3bacf7 100644 --- a/src/GameManager.cpp +++ b/src/GameManager.cpp @@ -2929,8 +2929,16 @@ void GameManager::GetStepsTypesForGame( const Game *pGame, vector& aS { for( int i=0; pGame->m_apStyles[i]; ++i ) { - const StepsType st = pGame->m_apStyles[i]->m_StepsType; + StepsType st = pGame->m_apStyles[i]->m_StepsType; ASSERT(st < NUM_StepsType); + + // Some Styles use the same StepsType (e.g. single and versus) so check + // that we aren't doubling up. + bool found = false; + for( int j=0; j < aStepsTypeAddTo.size(); j++ ) + if( (int) st == (int) aStepsTypeAddTo[j] ) { found = true; break; } + if(found) continue; + aStepsTypeAddTo.push_back( st ); } }