From b5d0545f42005aca8b7d66cad8d538493f529a03 Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Sun, 10 Aug 2003 00:39:28 +0000 Subject: [PATCH] some bugfixes to option screens: 1) fixed normal/difficult course difficulty if single player (kept defaulting to second player's option which didn't exist) 2) battery # of lives now defaults to 4 on an invalid value --- stepmania/src/ScreenPlayerOptions.cpp | 11 +++++++++++ stepmania/src/ScreenSongOptions.cpp | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/stepmania/src/ScreenPlayerOptions.cpp b/stepmania/src/ScreenPlayerOptions.cpp index 81861e8872..4d8a98bcdb 100644 --- a/stepmania/src/ScreenPlayerOptions.cpp +++ b/stepmania/src/ScreenPlayerOptions.cpp @@ -271,6 +271,11 @@ void ScreenPlayerOptions::ExportOptions() * erase everything. */ // po.Init(); + // if player isn't enabled, don't bother parsing options + // **very important for nonstop difficulties** + if (!GAMESTATE->IsPlayerEnabled(p)) + continue; + switch( m_iSelectedOption[p][PO_SPEED] ) { case 0: po.m_bTimeSpacing = false; po.m_fScrollSpeed = 0.25f; break; @@ -335,9 +340,15 @@ void ScreenPlayerOptions::ExportOptions() if( GAMESTATE->m_pCurCourse ) // playing a course { if( m_iSelectedOption[p][PO_STEP] == 1 ) + { GAMESTATE->m_bDifficultCourses = true; + LOG->Trace("ScreenPlayerOptions: Using difficult course"); + } else + { GAMESTATE->m_bDifficultCourses = false; + LOG->Trace("ScreenPlayerOptions: Using normal course"); + } } else { diff --git a/stepmania/src/ScreenSongOptions.cpp b/stepmania/src/ScreenSongOptions.cpp index 668e0c6bbe..bcbcbb6413 100644 --- a/stepmania/src/ScreenSongOptions.cpp +++ b/stepmania/src/ScreenSongOptions.cpp @@ -75,6 +75,10 @@ void ScreenSongOptions::ImportOptions() m_iSelectedOption[0][SO_LIFE] = so.m_LifeType; m_iSelectedOption[0][SO_BAT_LIVES] = so.m_iBatteryLives-1; + + if ( m_iSelectedOption[0][SO_BAT_LIVES] < 0 ) + m_iSelectedOption[0][SO_BAT_LIVES] = 3; // default in case value is invalid + m_iSelectedOption[0][SO_FAIL] = so.m_FailType; m_iSelectedOption[0][SO_ASSIST] = so.m_bAssistTick; m_iSelectedOption[0][SO_AUTOSYNC] = so.m_bAutoSync;