Fixed loading of ssc format edit files.
This commit is contained in:
+22
-11
@@ -895,7 +895,12 @@ bool SSCLoader::LoadNoteDataFromSimfile( const RString & cachePath, Steps &out )
|
|||||||
{ tryingSteps = false; }
|
{ tryingSteps = false; }
|
||||||
break;
|
break;
|
||||||
case LNDID_difficulty:
|
case LNDID_difficulty:
|
||||||
if(out.GetDifficulty() != StringToDifficulty(matcher))
|
// Accept any difficulty if it's an edit because LoadEditFromMsd
|
||||||
|
// forces edits onto Edit difficulty even if they have a difficulty
|
||||||
|
// tag. -Kyz
|
||||||
|
if(out.GetDifficulty() != StringToDifficulty(matcher) &&
|
||||||
|
!(out.GetDifficulty() == Difficulty_Edit &&
|
||||||
|
GetExtension(cachePath).MakeLower() == "edit"))
|
||||||
{ tryingSteps = false; }
|
{ tryingSteps = false; }
|
||||||
break;
|
break;
|
||||||
case LNDID_meter:
|
case LNDID_meter:
|
||||||
@@ -1125,13 +1130,27 @@ bool SSCLoader::LoadEditFromMsd(const MsdFile &msd,
|
|||||||
if(!bAddStepsToSong)
|
if(!bAddStepsToSong)
|
||||||
{ return true; }
|
{ return true; }
|
||||||
|
|
||||||
|
// Force the difficulty to edit in case the edit set its own
|
||||||
|
// difficulty because IsEditAlreadyLoaded has an assert and edits
|
||||||
|
// shouldn't be able to add charts of other difficulties. -Kyz
|
||||||
|
if(pNewNotes != NULL)
|
||||||
|
{
|
||||||
|
pNewNotes->SetDifficulty(Difficulty_Edit);
|
||||||
|
if(pSong->IsEditAlreadyLoaded(pNewNotes))
|
||||||
|
{
|
||||||
|
LOG->UserLog("Edit file", sEditFilePath,
|
||||||
|
"is a duplicate of another edit that was already loaded.");
|
||||||
|
SAFE_DELETE(pNewNotes);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(reused_steps_info.ssc_format)
|
if(reused_steps_info.ssc_format)
|
||||||
{
|
{
|
||||||
if(reused_steps_info.has_own_timing)
|
if(reused_steps_info.has_own_timing)
|
||||||
pNewNotes->m_Timing = stepsTiming;
|
{ pNewNotes->m_Timing = stepsTiming; }
|
||||||
pNewNotes->SetSMNoteData(sParams[1]);
|
pNewNotes->SetSMNoteData(sParams[1]);
|
||||||
pNewNotes->TidyUpData();
|
pNewNotes->TidyUpData();
|
||||||
pSong->AddSteps(pNewNotes);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1149,14 +1168,6 @@ bool SSCLoader::LoadEditFromMsd(const MsdFile &msd,
|
|||||||
pNewNotes->SetDifficulty(Difficulty_Edit);
|
pNewNotes->SetDifficulty(Difficulty_Edit);
|
||||||
pNewNotes->SetFilename(sEditFilePath);
|
pNewNotes->SetFilename(sEditFilePath);
|
||||||
|
|
||||||
if(pSong->IsEditAlreadyLoaded(pNewNotes))
|
|
||||||
{
|
|
||||||
LOG->UserLog("Edit file", sEditFilePath,
|
|
||||||
"is a duplicate of another edit that was already loaded.");
|
|
||||||
SAFE_DELETE(pNewNotes);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
pSong->AddSteps(pNewNotes);
|
pSong->AddSteps(pNewNotes);
|
||||||
return true; // Only allow one Steps per edit file!
|
return true; // Only allow one Steps per edit file!
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user