Make GetProfiles return an empty array in case of no profiles
This commit is contained in:
1 parent
e66d108df0
commit
774035e886
3 files changed
+3
-9
No files matched your search
@@ -457,7 +457,7 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
|
||||
public override void LeavingHighscore()
|
||||
{
|
||||
for (int i = 0; i < CBase.Game.GetNumSongs();i++ )
|
||||
for (int i = 0; i < CBase.Game.GetNumSongs(); i++)
|
||||
CBase.Songs.AddPartySongSung(CBase.Game.GetSong(i).ID);
|
||||
_GameData.CurrentRoundNr++;
|
||||
CBase.Graphics.FadeTo(EScreens.ScreenPartyDummy);
|
||||
@@ -588,12 +588,6 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
|
||||
{
|
||||
CProfile[] profiles = CBase.Profiles.GetProfiles();
|
||||
|
||||
if (profiles == null)
|
||||
{
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[] {"foo", "bar"};
|
||||
return;
|
||||
}
|
||||
|
||||
if (_GameData.NumPlayerAtOnce < 1 || _GameData.ProfileIDs.Count < _GameData.NumPlayerAtOnce || profiles.Length < _GameData.NumPlayerAtOnce)
|
||||
{
|
||||
_ScreenSongOptions.Selection.TeamNames = new string[] {"foo", "bar"};
|
||||
|
||||
@@ -888,7 +888,7 @@ namespace Vocaluxe.Base
|
||||
for (int j = 0; j < CSettings.MaxNumPlayer; j++)
|
||||
{
|
||||
CGame.Players[j].ProfileID = -1;
|
||||
if (Players[j] == "" || profiles == null)
|
||||
if (Players[j] == "")
|
||||
continue;
|
||||
|
||||
foreach (CProfile profile in profiles)
|
||||
|
||||
@@ -297,7 +297,7 @@ namespace Vocaluxe.Base
|
||||
public static CProfile[] GetProfiles()
|
||||
{
|
||||
if (_Profiles.Count == 0)
|
||||
return null;
|
||||
return new CProfile[0];
|
||||
|
||||
var list = new List<CProfile>(_Profiles.Values);
|
||||
list.Sort(_CompareByPlayerName);
|
||||
|
||||
Reference in new issue
Block a user