aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-11-18 15:34:06 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-11-18 15:34:06 +0000
commit64e2aab2ea368ed666ad1afd7105e06917eeadb7 (patch)
tree44781cdc0e1a7d63bf81ba5f944867bd0e9e9bdc
parent9975f56cded5f6251d0110238fd97b7ee7ccae31 (diff)
downloadusdx-64e2aab2ea368ed666ad1afd7105e06917eeadb7.tar.gz
usdx-64e2aab2ea368ed666ad1afd7105e06917eeadb7.tar.xz
usdx-64e2aab2ea368ed666ad1afd7105e06917eeadb7.zip
fixed TCatSongs.FindNextVisible
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1951 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--src/base/USongs.pas14
1 files 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