Skip to content

Commit 833e886

Browse files
committed
Fix NotesLoaderSM not being able to load forced edit diffs (dupe diffs)
similar to the case with NotesLoaderDWI. what is different here is that as far as I can tell, we have the chartkey already set, so we can generate a new one based on the given notedata (i dont care how slow this is) and see if it matches to find the notedata we are looking for
1 parent 1ea4c49 commit 833e886

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/Etterna/Models/NoteLoaders/NotesLoaderSM.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include "RageUtil/Misc/RageLog.h"
1010
#include "RageUtil/Utils/RageUtil.h"
1111
#include "Etterna/Models/Songs/Song.h"
12+
#include "Etterna/Models/StepsAndStyles/Steps.h"
13+
#include "Etterna/Models/NoteData/NoteData.h"
1214
#include "Etterna/Singletons/SongManager.h"
1315
#include "Etterna/Models/StepsAndStyles/Steps.h"
1416

@@ -1103,7 +1105,23 @@ SMLoader::LoadNoteDataFromSimfile(const RString& path, Steps& out)
11031105
(out.GetDifficulty() == StringToDifficulty(difficulty) ||
11041106
out.GetDifficulty() ==
11051107
OldStyleStringToDifficulty(difficulty)))) {
1106-
continue;
1108+
if (out.IsDupeDiff()) {
1109+
// for duplicate difficulties, check by chartkey.
1110+
// not aware of a case where chartkey is not filled here.
1111+
RString noteData = sParams[6];
1112+
Trim(noteData);
1113+
Steps tmp(out.m_pSong);
1114+
tmp.m_Timing = out.m_Timing;
1115+
tmp.m_StepsType = out.m_StepsType;
1116+
tmp.SetSMNoteData(noteData);
1117+
NoteData tnd = tmp.GetNoteData();
1118+
tnd.LogNonEmptyRows();
1119+
1120+
auto ck = tmp.GenerateChartKey(tnd, tmp.GetTimingData());
1121+
if (ck != out.GetChartKey())
1122+
continue;
1123+
} else
1124+
continue;
11071125
}
11081126

11091127
RString noteData = sParams[6];

0 commit comments

Comments
 (0)