Skip to content

Commit

Permalink
Maybe fix hitting taps after hold ends when hitting before the hold end
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Feb 9, 2019
1 parent 77ecb13 commit 033452c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,8 @@ Player::Update(float fDeltaTime)
int iRow = iter.Row();
TrackRowTapNote trtn = { iTrack, iRow, &tn };

lastHoldHeadSeconds = max(lastHoldHeadSeconds,m_Timing->WhereUAtBro(NoteRowToBeat(iRow+ tn.iDuration)));

/* All holds must be of the same subType because fLife is handled
* in different ways depending on the SubType. Handle Rolls one at
* a time and don't mix with holds. */
Expand Down Expand Up @@ -2146,6 +2148,8 @@ Player::Step(int col,
if (iRowOfOverlappingNoteOrRow != -1) {
// compute the score for this hit
float fNoteOffset = 0.f;
// only valid if
float fMusicSeconds;
// we need this later if we are autosyncing
const float fStepBeat = NoteRowToBeat(iRowOfOverlappingNoteOrRow);
const float fStepSeconds = m_Timing->WhereUAtBro(fStepBeat);
Expand All @@ -2163,7 +2167,7 @@ Player::Step(int col,
GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate);

// ... which means it happened at this point in the music:
const float fMusicSeconds =
fMusicSeconds =
fCurrentMusicSeconds -
fTimeSinceStep *
GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate;
Expand Down Expand Up @@ -2219,6 +2223,8 @@ Player::Step(int col,
}
// Fall through to default.
default:
if (lastHoldHeadSeconds - fMusicSeconds > 0.0f)
break;
if ((pTN->type == TapNoteType_Lift) == bRelease) {
if (fSecondsFromExact <= GetWindowSeconds(TW_W1))
score = TNS_W1;
Expand Down
2 changes: 2 additions & 0 deletions src/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ class Player : public ActorFrame
TimingData* m_Timing;
float m_fNoteFieldHeight;

float lastHoldHeadSeconds{ 0.0f };

bool m_bPaused;
bool m_bDelay;

Expand Down

0 comments on commit 033452c

Please sign in to comment.