From 64e2aab2ea368ed666ad1afd7105e06917eeadb7 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 18 Nov 2009 15:34:06 +0000 Subject: fixed TCatSongs.FindNextVisible git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1951 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/base/USongs.pas | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/base/USongs.pas b/src/base/USongs.pas index d3018bcf..baeec13a 100644 --- a/src/base/USongs.pas +++ b/src/base/USongs.pas @@ -727,14 +727,18 @@ var I: integer; begin Result := -1; - I := SearchFrom + 1; - while not CatSongs.Song[I].Visible do + I := SearchFrom; + while (Result = -1) do begin Inc (I); - if (I>high(CatSongs.Song)) then - I := low(CatSongs.Song); + + if (I > High(CatSongs.Song)) then + I := Low(CatSongs.Song); if (I = SearchFrom) then // Make One Round and no song found->quit - break; + Break; + + if (CatSongs.Song[I].Visible) then + Result := I; end; end; // Wrong song selected when tabs on bug End -- cgit v1.2.3