diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-07-15 18:13:59 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-07-15 18:13:59 +0000 |
commit | abf2c5300a9ffca0159199237da2f442aa3a57aa (patch) | |
tree | e26fecceec5ea5b1eb48982ac61cafb207550077 /Game | |
parent | a65e818d0a8ecac47b7710e8546897e271d0ca44 (diff) | |
download | usdx-abf2c5300a9ffca0159199237da2f442aa3a57aa.tar.gz usdx-abf2c5300a9ffca0159199237da2f442aa3a57aa.tar.xz usdx-abf2c5300a9ffca0159199237da2f442aa3a57aa.zip |
Fixed a bug in Party playlist selection when no playlist or category is available
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@298 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game')
-rw-r--r-- | Game/Code/Screens/UScreenPartyOptions.pas | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/Game/Code/Screens/UScreenPartyOptions.pas b/Game/Code/Screens/UScreenPartyOptions.pas index aa8681d0..49cc8c53 100644 --- a/Game/Code/Screens/UScreenPartyOptions.pas +++ b/Game/Code/Screens/UScreenPartyOptions.pas @@ -63,11 +63,15 @@ begin SDLK_RETURN:
begin
+ //Don'T start when Playlist is Selected and there are no Playlists
+ If (Playlist = 2) and (Length(PlaylistMan.Playlists) = 0) then
+ Exit;
+
//Save Difficulty
Ini.Difficulty := SelectsS[SelectLevel].SelectedOption;
Ini.SaveLevel;
- //Save PlayList
- //(Todo)
+
+
//Save Num Teams:
PartySession.Teams.NumTeams := NumTeams + 2;
PartySession.Teams.Teaminfo[0].NumPlayers := NumPlayer1+1;
@@ -76,6 +80,7 @@ begin //Save Playlist
PlaylistMan.Mode := Playlist;
+ PlaylistMan.CurPlayList := High(Cardinal);
//If Category Selected Search Category ID
if Playlist = 1 then
begin
@@ -91,6 +96,10 @@ begin Break;
end;
end;
+
+ //No Categorys or Invalid Entry
+ If PlaylistMan.CurPlayList = High(Cardinal) then
+ Exit;
end
else
PlaylistMan.CurPlayList := Playlist2;
@@ -203,11 +212,25 @@ begin IPlaylist2[high(IPlaylist2)] := CatSongs.Song[I].Artist;
end;
end;
+
+ If (Length(IPlaylist2) = 0) then
+ begin
+ SetLength(IPlaylist2, 1);
+ IPlaylist2[0] := 'No Categories found';
+ end;
end;
2:
begin
- SetLength(IPlaylist2, Length(PlaylistMan.Playlists));
- PlaylistMan.GetNames(IPlaylist2);
+ if (Length(PlaylistMan.Playlists) > 0) then
+ begin
+ SetLength(IPlaylist2, Length(PlaylistMan.Playlists));
+ PlaylistMan.GetNames(IPlaylist2);
+ end
+ else
+ begin
+ SetLength(IPlaylist2, 1);
+ IPlaylist2[0] := 'No Playlists found';
+ end;
end;
end;
|