From 39b631da519adb1ee8be7568aaacddd755746c68 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 15 Jun 2005 09:25:33 +0000 Subject: [PATCH] fix saving of machine scores for machine edits --- stepmania/src/PaneDisplay.cpp | 2 +- stepmania/src/ProfileManager.cpp | 4 ++-- stepmania/src/Steps.h | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/stepmania/src/PaneDisplay.cpp b/stepmania/src/PaneDisplay.cpp index 596fefd857..81c78ac9e6 100644 --- a/stepmania/src/PaneDisplay.cpp +++ b/stepmania/src/PaneDisplay.cpp @@ -175,7 +175,7 @@ void PaneDisplay::SetContent( PaneContents c ) const Course *pCourse = GAMESTATE->m_pCurCourse; const Trail *pTrail = GAMESTATE->m_pCurTrail[m_PlayerNumber]; const Profile *pProfile = PROFILEMAN->IsPersistentProfile(m_PlayerNumber) ? PROFILEMAN->GetProfile(m_PlayerNumber) : NULL; - bool bIsPlayerEdit = pSteps && pSteps->IsAnEdit() && pSteps->GetLoadedFromProfileSlot() != PROFILE_SLOT_MACHINE; + bool bIsPlayerEdit = pSteps && pSteps->IsAPlayerEdit(); if( (g_Contents[c].req&NEED_NOTES) && !pSteps ) goto done; diff --git a/stepmania/src/ProfileManager.cpp b/stepmania/src/ProfileManager.cpp index 8eab05df98..23925fe089 100644 --- a/stepmania/src/ProfileManager.cpp +++ b/stepmania/src/ProfileManager.cpp @@ -500,8 +500,8 @@ void ProfileManager::AddStepsScore( const Song* pSong, const Steps* pSteps, Play if( PROFILEMAN->IsPersistentProfile(pn) ) PROFILEMAN->GetProfile(pn)->AddStepsHighScore( pSong, pSteps, hs, iPersonalIndexOut ); - // don't leave machine high scores for edits - if( pSteps->GetDifficulty() != DIFFICULTY_EDIT ) + // don't leave machine high scores for edits loaded from the player's card + if( !pSteps->IsAPlayerEdit() ) PROFILEMAN->GetMachineProfile()->AddStepsHighScore( pSong, pSteps, hs, iMachineIndexOut ); } diff --git a/stepmania/src/Steps.h b/stepmania/src/Steps.h index baca3dbfca..e5e8883b67 100644 --- a/stepmania/src/Steps.h +++ b/stepmania/src/Steps.h @@ -31,6 +31,7 @@ public: // Use a special value of difficulty bool IsAnEdit() const { return m_Difficulty == DIFFICULTY_EDIT; } + bool IsAPlayerEdit() const { return m_Difficulty == DIFFICULTY_EDIT && GetLoadedFromProfileSlot() < PROFILE_SLOT_MACHINE; } bool WasLoadedFromProfile() const { return m_LoadedFromProfile != PROFILE_SLOT_INVALID; } ProfileSlot GetLoadedFromProfileSlot() const { return m_LoadedFromProfile; } unsigned GetHash() const { return Real()->m_uHash; }