bug fix: HighScores for edits don't match correctly because the hash is ignored

This commit is contained in:
Chris Danford
2004-11-24 16:32:21 +00:00
parent 8fe7c75a9a
commit 8e476b97c0
3 changed files with 9 additions and 3 deletions
+5 -1
View File
@@ -833,6 +833,7 @@ void Song::GetSteps(
int iMeterHigh, int iMeterHigh,
const CString &sDescription, const CString &sDescription,
bool bIncludeAutoGen, bool bIncludeAutoGen,
unsigned uHash,
int iMaxToGet int iMaxToGet
) const ) const
{ {
@@ -852,6 +853,8 @@ void Song::GetSteps(
continue; continue;
if( sDescription.size() && sDescription != pSteps->GetDescription() ) if( sDescription.size() && sDescription != pSteps->GetDescription() )
continue; continue;
if( uHash != 0 && uHash != pSteps->GetHash() )
continue;
if( !bIncludeAutoGen && pSteps->IsAutogen() ) if( !bIncludeAutoGen && pSteps->IsAutogen() )
continue; continue;
@@ -872,11 +875,12 @@ Steps* Song::GetSteps(
int iMeterLow, int iMeterLow,
int iMeterHigh, int iMeterHigh,
const CString &sDescription, const CString &sDescription,
unsigned uHash,
bool bIncludeAutoGen bool bIncludeAutoGen
) const ) const
{ {
vector<Steps*> vpSteps; vector<Steps*> vpSteps;
GetSteps( vpSteps, st, dc, iMeterLow, iMeterHigh, sDescription, bIncludeAutoGen, 1 ); // get max 1 GetSteps( vpSteps, st, dc, iMeterLow, iMeterHigh, sDescription, bIncludeAutoGen, uHash, 1 ); // get max 1
if( vpSteps.empty() ) if( vpSteps.empty() )
return NULL; return NULL;
else else
+2 -2
View File
@@ -157,11 +157,11 @@ Steps *StepsID::ToSteps( const Song *p, bool bAllowNull, bool bUseCache ) const
Steps *ret = NULL; Steps *ret = NULL;
if( dc == DIFFICULTY_EDIT ) if( dc == DIFFICULTY_EDIT )
{ {
ret = p->GetSteps( st, dc, -1, -1, sDescription, true ); ret = p->GetSteps( st, dc, -1, -1, sDescription, uHash, true );
} }
else else
{ {
ret = p->GetSteps( st, dc, -1, -1, "", true ); ret = p->GetSteps( st, dc, -1, -1, "", 0, true );
} }
if( !bAllowNull ) if( !bAllowNull )
+2
View File
@@ -181,6 +181,7 @@ public:
int iMeterHigh = -1, int iMeterHigh = -1,
const CString &sDescription = "", const CString &sDescription = "",
bool bIncludeAutoGen = true, bool bIncludeAutoGen = true,
unsigned uHash = 0,
int iMaxToGet = -1 int iMaxToGet = -1
) const; ) const;
Steps* GetSteps( Steps* GetSteps(
@@ -189,6 +190,7 @@ public:
int iMeterLow = -1, int iMeterLow = -1,
int iMeterHigh = -1, int iMeterHigh = -1,
const CString &sDescription = "", const CString &sDescription = "",
unsigned uHash = 0,
bool bIncludeAutoGen = true bool bIncludeAutoGen = true
) const; ) const;
Steps* GetStepsByDifficulty( StepsType st, Difficulty dc, bool bIncludeAutoGen = true ) const; Steps* GetStepsByDifficulty( StepsType st, Difficulty dc, bool bIncludeAutoGen = true ) const;