From 835fb1f00436e8ad28b18b727fc5710204d2a72f Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 2 Apr 2005 10:36:44 +0000 Subject: [PATCH] fix bogus max beat check would let you place new notes 1 measure past the last note --- stepmania/src/ScreenEdit.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index 467b7c490c..28cf4b0575 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -996,6 +996,9 @@ void ScreenEdit::InputEdit( const DeviceInput& DeviceI, const InputEventType typ iOriginalRow = max( iOriginalRow, 0 ); iDestinationRow = max( iDestinationRow, 0 ); + if( iOriginalRow == iDestinationRow ) // didn't change rows, so don't create a hold + continue; + // Don't SaveUndo. We want to undo the whole hold, not just the last segment // that the user made. Dragging the hold bigger can only absorb and remove // other taps, so dragging won't cause us to exceed the note limit. @@ -2624,17 +2627,20 @@ float ScreenEdit::GetMaximumBeat() const { if( GAMESTATE->m_pCurSteps[0]->IsAnEdit() ) { - // Jump to GetLastBeat even if it's past m_pCurSong->m_fLastBeat - // so that users can delete garbage steps past then end that they have - // have inserted in a text editor. Once they delete all steps on - // GetLastBeat() and move off of that beat, they won't be able to return. - float fEndBeat = max( m_NoteDataEdit.GetLastBeat(), GAMESTATE->m_pCurSong->m_fLastBeat ); + float fEndBeat = GAMESTATE->m_pCurSong->m_fLastBeat; // Round up to the next measure end. Some songs end on weird beats // mid-measure, and it's odd to have movement capped to these weird // beats. fEndBeat += BEATS_PER_MEASURE; fEndBeat = ftruncf( fEndBeat, (float)BEATS_PER_MEASURE ); + + // Jump to GetLastBeat even if it's past m_pCurSong->m_fLastBeat + // so that users can delete garbage steps past then end that they have + // have inserted in a text editor. Once they delete all steps on + // GetLastBeat() and move off of that beat, they won't be able to return. + fEndBeat = max( fEndBeat, GAMESTATE->m_pCurSong->m_fLastBeat ); + return fEndBeat; } else