Make GetProfiles return an empty array in case of no profiles

This commit is contained in:
Flamefire committed 2014-09-07 12:11:42 +02:00
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() 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); CBase.Songs.AddPartySongSung(CBase.Game.GetSong(i).ID);
_GameData.CurrentRoundNr++; _GameData.CurrentRoundNr++;
CBase.Graphics.FadeTo(EScreens.ScreenPartyDummy); CBase.Graphics.FadeTo(EScreens.ScreenPartyDummy);
@@ -588,12 +588,6 @@ namespace VocaluxeLib.PartyModes.ChallengeMedley
{ {
CProfile[] profiles = CBase.Profiles.GetProfiles(); 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) if (_GameData.NumPlayerAtOnce < 1 || _GameData.ProfileIDs.Count < _GameData.NumPlayerAtOnce || profiles.Length < _GameData.NumPlayerAtOnce)
{ {
_ScreenSongOptions.Selection.TeamNames = new string[] {"foo", "bar"}; _ScreenSongOptions.Selection.TeamNames = new string[] {"foo", "bar"};
+1 -1
View File
@@ -888,7 +888,7 @@ namespace Vocaluxe.Base
for (int j = 0; j < CSettings.MaxNumPlayer; j++) for (int j = 0; j < CSettings.MaxNumPlayer; j++)
{ {
CGame.Players[j].ProfileID = -1; CGame.Players[j].ProfileID = -1;
if (Players[j] == "" || profiles == null) if (Players[j] == "")
continue; continue;
foreach (CProfile profile in profiles) foreach (CProfile profile in profiles)
+1 -1
View File
@@ -297,7 +297,7 @@ namespace Vocaluxe.Base
public static CProfile[] GetProfiles() public static CProfile[] GetProfiles()
{ {
if (_Profiles.Count == 0) if (_Profiles.Count == 0)
return null; return new CProfile[0];
var list = new List<CProfile>(_Profiles.Values); var list = new List<CProfile>(_Profiles.Values);
list.Sort(_CompareByPlayerName); list.Sort(_CompareByPlayerName);