From 1aa0b38c9fc99cdd05db2f2fb82b6ca6fca9138c Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 5 Jun 2006 07:36:23 +0000 Subject: [PATCH] fix SUnlockBrowse unlocking entry 1 when all entries are disabled --- stepmania/src/ScreenSelect.cpp | 6 ++++-- stepmania/src/UnlockManager.cpp | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/stepmania/src/ScreenSelect.cpp b/stepmania/src/ScreenSelect.cpp index 2c6ec7e6e4..5a2bb17876 100644 --- a/stepmania/src/ScreenSelect.cpp +++ b/stepmania/src/ScreenSelect.cpp @@ -202,7 +202,8 @@ void ScreenSelect::HandleScreenMessage( const ScreenMessage SM ) { const GameCommand &gc = m_aGameCommands[iMastersIndex]; m_sNextScreen = gc.m_sScreen; - gc.ApplyToAllPlayers(); + if( !gc.m_bInvalid ) + gc.ApplyToAllPlayers(); } else { @@ -211,7 +212,8 @@ void ScreenSelect::HandleScreenMessage( const ScreenMessage SM ) int iIndex = this->GetSelectionIndex(p); const GameCommand &gc = m_aGameCommands[iIndex]; m_sNextScreen = gc.m_sScreen; - gc.Apply( p ); + if( !gc.m_bInvalid ) + gc.Apply( p ); } } diff --git a/stepmania/src/UnlockManager.cpp b/stepmania/src/UnlockManager.cpp index 6e32a4c938..f18718a355 100644 --- a/stepmania/src/UnlockManager.cpp +++ b/stepmania/src/UnlockManager.cpp @@ -528,6 +528,7 @@ void UnlockManager::Reload() float UnlockManager::PointsUntilNextUnlock( UnlockRequirement t ) const { float fScores[NUM_UnlockRequirement]; + ZERO( fScores ); UNLOCKMAN->GetPoints( PROFILEMAN->GetMachineProfile(), fScores ); float fSmallestPoints = FLT_MAX; // or an arbitrarily large value