fix stale Steps* in Trail being used after reverting songs from disk
This commit is contained in:
+14
-16
@@ -288,26 +288,24 @@ int Profile::GetPossibleCourseDancePointsForStepsType( StepsType st ) const
|
|||||||
int iTotal = 0;
|
int iTotal = 0;
|
||||||
|
|
||||||
// add course high scores
|
// add course high scores
|
||||||
|
vector<Course*> vCourses;
|
||||||
|
SONGMAN->GetAllCourses( vCourses, false );
|
||||||
|
for( unsigned i=0; i<vCourses.size(); i++ )
|
||||||
{
|
{
|
||||||
vector<Course*> vCourses;
|
const Course* pCourse = vCourses[i];
|
||||||
SONGMAN->GetAllCourses( vCourses, false );
|
|
||||||
for( unsigned i=0; i<vCourses.size(); i++ )
|
|
||||||
{
|
|
||||||
const Course* pCourse = vCourses[i];
|
|
||||||
|
|
||||||
// Don't count any course that has any entries that change over time.
|
// Don't count any course that has any entries that change over time.
|
||||||
if( !pCourse->AllSongsAreFixed() )
|
if( !pCourse->AllSongsAreFixed() )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
FOREACH_ShownCourseDifficulty( cd )
|
||||||
|
{
|
||||||
|
Trail* pTrail = pCourse->GetTrail(st,cd);
|
||||||
|
if( pTrail == NULL )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
FOREACH_ShownCourseDifficulty( cd )
|
const RadarValues& fRadars = pTrail->GetRadarValues();
|
||||||
{
|
iTotal += ScoreKeeperMAX2::GetPossibleDancePoints( fRadars );
|
||||||
Trail* pTrail = pCourse->GetTrail(st,cd);
|
|
||||||
if( pTrail == NULL )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
const RadarValues& fRadars = pTrail->GetRadarValues();
|
|
||||||
iTotal += ScoreKeeperMAX2::GetPossibleDancePoints( fRadars );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1804,6 +1804,13 @@ void RevertChanges( void* papSongsQueue )
|
|||||||
vector<Song*>& apSongsQueue = *(vector<Song*>*)papSongsQueue;
|
vector<Song*>& apSongsQueue = *(vector<Song*>*)papSongsQueue;
|
||||||
for( unsigned i=0; i<apSongsQueue.size(); i++ )
|
for( unsigned i=0; i<apSongsQueue.size(); i++ )
|
||||||
apSongsQueue[i]->RevertFromDisk();
|
apSongsQueue[i]->RevertFromDisk();
|
||||||
|
|
||||||
|
// We need to regen any Courses that have any of the songs we just reloaded.
|
||||||
|
// Regen all Courses for now.
|
||||||
|
vector<Course*> vpAllCourses;
|
||||||
|
SONGMAN->GetAllCourses( vpAllCourses, true );
|
||||||
|
FOREACH( Course*, vpAllCourses, pCourse )
|
||||||
|
(*pCourse)->RegenTrails();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenGameplay::ShowSavePrompt( ScreenMessage SM_SendWhenDone )
|
void ScreenGameplay::ShowSavePrompt( ScreenMessage SM_SendWhenDone )
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ class Steps;
|
|||||||
|
|
||||||
struct StageStats
|
struct StageStats
|
||||||
{
|
{
|
||||||
StageStats();
|
StageStats() { Init(); }
|
||||||
|
void Init();
|
||||||
void AddStats( const StageStats& other ); // accumulate
|
void AddStats( const StageStats& other ); // accumulate
|
||||||
Grade GetGrade( PlayerNumber pn ) const;
|
Grade GetGrade( PlayerNumber pn ) const;
|
||||||
bool OnePassed() const;
|
bool OnePassed() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user