From 4f972ef69bbcd0e88f0265fc252326ccbfcfed94 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 2 Nov 2002 21:03:20 +0000 Subject: [PATCH] fix crash due to unsigned (oops) --- stepmania/src/GroupList.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stepmania/src/GroupList.cpp b/stepmania/src/GroupList.cpp index ff3cd1fe2e..48f60b15a2 100644 --- a/stepmania/src/GroupList.cpp +++ b/stepmania/src/GroupList.cpp @@ -121,12 +121,15 @@ void GroupList::SetSelection( unsigned sel ) if( m_iSelection >= MAX_GROUPS_ONSCREEN/2 ) m_iTop++; } else if( sel == m_iSelection-1 ) { - if(m_iSelection < m_textLabels.size() - MAX_GROUPS_ONSCREEN/2) + if(m_iTop && m_iSelection < m_textLabels.size() - MAX_GROUPS_ONSCREEN/2) m_iTop--; } else { /* We're jumping somewhere else; just put the top somewhere * reasonable. */ - m_iTop = sel - MAX_GROUPS_ONSCREEN/2; + if(sel >= MAX_GROUPS_ONSCREEN/2) + m_iTop = sel - MAX_GROUPS_ONSCREEN/2; + else + m_iTop = 0; } m_iSelection=sel;