From 683b32706487e37eace349c135f737d9a7782670 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 11 Dec 2003 21:26:57 +0000 Subject: [PATCH] fix crash with empty steps --- stepmania/src/NoteData.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/stepmania/src/NoteData.cpp b/stepmania/src/NoteData.cpp index f7d2463eac..36c646330d 100644 --- a/stepmania/src/NoteData.cpp +++ b/stepmania/src/NoteData.cpp @@ -415,8 +415,8 @@ int NoteData::GetNumTapNotes( float fStartBeat, float fEndBeat ) const int iEndIndex = BeatToNoteRow( fEndBeat ); /* Clamp to known-good ranges. */ - iStartIndex = clamp( iStartIndex, 0, GetMaxRow()-1 ); - iEndIndex = clamp( iEndIndex, 0, GetMaxRow()-1 ); + iStartIndex = max( iStartIndex, 0 ); + iEndIndex = min( iEndIndex, GetMaxRow()-1 ); for( int t=0; t