Skip to content

Commit

Permalink
Fix crash when grabbing offset vectors for old replays
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Nov 27, 2018
1 parent a93ed09 commit 17d6195
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/PlayerStageStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1040,9 +1040,16 @@ LuaFunction(GetGradeFromPercent, GetGradeFromPercent(FArg(1)))
auto& offs = p->m_vOffsetVector;
auto& type = p->m_vTapNoteTypeVector;
vector<float> doot;
for (size_t i = 0; i < offs.size(); ++i)
if (type[i] != TapNoteType_Mine)
// type would not be empty in Full Replays (> v0.60)
if (!type.empty()) {
for (size_t i = 0; i < offs.size(); ++i)
if (type[i] != TapNoteType_Mine)
doot.emplace_back(offs[i] * 1000);
} else {
// But type is empty if the replay is old :(
for (size_t i = 0; i < offs.size(); ++i)
doot.emplace_back(offs[i] * 1000);
}
LuaHelpers::CreateTableFromArray(doot, L);
return 1;
}
Expand Down

0 comments on commit 17d6195

Please sign in to comment.