From 91e633d8808e7a354a19089d0154853cf6900d94 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 19 Jan 2004 20:46:34 +0000 Subject: [PATCH] fix CopyRange receiving legitimate -1 values for ToIndexBegin and shifting everything by one row --- stepmania/src/NoteData.cpp | 6 +----- stepmania/src/NoteData.h | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/stepmania/src/NoteData.cpp b/stepmania/src/NoteData.cpp index 32cfa7cbcf..0fc7ddc3c2 100644 --- a/stepmania/src/NoteData.cpp +++ b/stepmania/src/NoteData.cpp @@ -84,9 +84,6 @@ void NoteData::CopyRange( const NoteData* pFrom, int iFromIndexBegin, int iFromI { ASSERT( pFrom->m_iNumTracks == m_iNumTracks ); - if( iToIndexBegin == -1 ) - iToIndexBegin = 0; - NoteData From, To; From.To4s( *pFrom ); To.To4s( *this ); @@ -288,8 +285,7 @@ int NoteData::GetMatchingHoldNote( const HoldNote &hn ) const if( ret.iTrack == hn.iTrack && ret.iEndRow == hn.iEndRow ) return i; } - ASSERT(0); - return -1; + FAIL_M( ssprintf("%i..%i, %i", hn.iStartRow, hn.iEndRow, hn.iTrack) ); } diff --git a/stepmania/src/NoteData.h b/stepmania/src/NoteData.h index 52b854bc0a..35f36062f7 100644 --- a/stepmania/src/NoteData.h +++ b/stepmania/src/NoteData.h @@ -71,7 +71,7 @@ public: void ClearRange( int iNoteIndexBegin, int iNoteIndexEnd ); void ClearAll(); - void CopyRange( const NoteData* pFrom, int iFromIndexBegin, int iFromIndexEnd, int iToIndexBegin = -1 ); + void CopyRange( const NoteData* pFrom, int iFromIndexBegin, int iFromIndexEnd, int iToIndexBegin = 0 ); void CopyAll( const NoteData* pFrom ); bool IsRowEmpty( int index ) const;