Skip to content

Commit

Permalink
fix replay hold drops triggering infinite times until i delete this code
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Sep 8, 2022
1 parent 08746de commit bf04f3e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Etterna/Models/Misc/PlayerAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,7 @@ PlayerAI::GetReplaySnapshotForNoterow(int row)
bool
PlayerAI::DetermineIfHoldDropped(int noteRow, int col)
{
bool o = false;
// LOG->Trace("Checking for hold.");
// Is the given row/column in our dropped hold map?
if (m_ReplayHoldMap.count(noteRow) != 0) {
Expand All @@ -830,11 +831,21 @@ PlayerAI::DetermineIfHoldDropped(int noteRow, int col)
// We found the column we are looking for
if (hrr.track == col) {
// LOG->Trace("KILL IT NOW");
return true;
o = true;
break;
}
}
}
return false;

if (o) {
auto it = m_ReplayHoldMap.at(noteRow).begin();
while (it != m_ReplayHoldMap.at(noteRow).end() && it->track != col) {
it++;
}
m_ReplayHoldMap.at(noteRow).erase(it);
}

return o;
}

int
Expand Down

0 comments on commit bf04f3e

Please sign in to comment.