From a6f09c5e7c9aaa33a1e00934fc00f197aaca188c Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 17 Jan 2007 12:41:53 +0000 Subject: [PATCH] Pressing a lower extra fret during a single fret hold breaks the hold. Pressing any extra fret during a two fret hold breaks the hold. --- stepmania/src/Player.cpp | 42 +++++++++++++++++++++++++++++++++++++++- stepmania/src/Player.h | 2 +- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index e5f09b52bc..7f27362596 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -1282,6 +1282,40 @@ void Player::Fret( int col, int row, const RageTimer &tm, bool bHeld, bool bRele if( bDoHopo ) Hopo( iHopoCol, row, tm, bHeld, bRelease ); + + + // Check if this fret breaks all active holds. + if( !bRelease ) + { + const float fSongBeat = GAMESTATE->m_fSongBeat; + const int iSongRow = BeatToNoteRow( fSongBeat ); + + int iMaxHoldCol = -1; + int iNumColsHeld = 0; + + // Score all active holds to NotHeld + for( int iTrack=0; iTracksecond; + if( tn.HoldResult.bActive ) + { + iMaxHoldCol = iTrack; + iNumColsHeld++; + } + } + } + + // Any frets to the right of an active hold will break the hold. + if( col > iMaxHoldCol || iNumColsHeld >= 2 ) + ScoreAllActiveHoldsLetGo(); + } } @@ -1297,7 +1331,7 @@ void Player::Strum( int col, int row, const RageTimer &tm, bool bHeld, bool bRel m_pPlayerState->m_fLastStrumMusicSeconds = GAMESTATE->m_fMusicSeconds; - //StepStrumHopo( col, row, tm, bHeld, bRelease, ButtonType_StrumFretsChanged ); + StepStrumHopo( col, row, tm, bHeld, bRelease, ButtonType_StrumFretsChanged ); } void Player::DoTapScoreNone() @@ -1337,6 +1371,11 @@ void Player::DoStrumMiss() m_pPlayerState->m_fLastStrumMusicSeconds = -1; DoTapScoreNone(); + ScoreAllActiveHoldsLetGo(); +} + +void Player::ScoreAllActiveHoldsLetGo() +{ if( PENALIZE_TAP_SCORE_NONE ) { const float fSongBeat = GAMESTATE->m_fSongBeat; @@ -1356,6 +1395,7 @@ void Player::DoStrumMiss() if( tn.HoldResult.bActive ) { tn.HoldResult.hns = HNS_LetGo; + tn.HoldResult.fLife = 0; HandleHoldScore( tn ); SetHoldJudgment( tn.result.tns, tn.HoldResult.hns, iTrack ); diff --git a/stepmania/src/Player.h b/stepmania/src/Player.h index 81912d06da..6bea8d5a7b 100644 --- a/stepmania/src/Player.h +++ b/stepmania/src/Player.h @@ -128,7 +128,7 @@ public: // Called when the strum window passes without a row being hit void DoStrumMiss(); - + void ScoreAllActiveHoldsLetGo(); void DoTapScoreNone(); enum ButtonType { ButtonType_Step, ButtonType_StrumFretsChanged, ButtonType_Hopo };