Fix crash without profiles.

This commit is contained in:
Florian Küpper committed 2013-03-30 12:59:34 +01:00
1 parent b0b3c09ab4
commit 6b04bc79eb
2 files changed
+7 -4

No files matched your search

+5 -2
View File
@@ -580,8 +580,11 @@ namespace Vocaluxe.Screens
//Update texture and name
if (CConfig.Players[i].Length > 0)
{
Statics[StaticPlayerAvatar[i]].Texture = CProfiles.Profiles[CGame.Player[i].ProfileID].Avatar.Texture;
Texts[TextPlayer[i]].Text = CProfiles.Profiles[CGame.Player[i].ProfileID].PlayerName;
if (CGame.Player[i].ProfileID > -1 && CProfiles.NumProfiles > CGame.Player[i].ProfileID)
{
Statics[StaticPlayerAvatar[i]].Texture = CProfiles.Profiles[CGame.Player[i].ProfileID].Avatar.Texture;
Texts[TextPlayer[i]].Text = CProfiles.Profiles[CGame.Player[i].ProfileID].PlayerName;
}
}
if (CGame.GetNumSongs() == 1 && CGame.GetSong(1).IsDuet)
{
+2 -2
View File
@@ -1342,7 +1342,7 @@ namespace Vocaluxe.Screens
{
for (int i = 0; i < CGame.NumPlayer; i++)
{
if (CGame.Player[i].ProfileID > -1)
if (CGame.Player[i].ProfileID > -1 && CProfiles.NumProfiles > CGame.Player[i].ProfileID)
Statics[StaticAvatars[i, CGame.NumPlayer - 1]].Texture = CProfiles.Profiles[CGame.Player[i].ProfileID].Avatar.Texture;
else
Statics[StaticAvatars[i, CGame.NumPlayer - 1]].Visible = false;
@@ -1353,7 +1353,7 @@ namespace Vocaluxe.Screens
{
for (int i = 0; i < CGame.NumPlayer; i++)
{
if (CGame.Player[i].ProfileID > -1)
if (CGame.Player[i].ProfileID > -1 && CProfiles.NumProfiles > CGame.Player[i].ProfileID)
Texts[TextNames[i, CGame.NumPlayer - 1]].Text = CProfiles.Profiles[CGame.Player[i].ProfileID].PlayerName;
else
Texts[TextNames[i, CGame.NumPlayer - 1]].Visible = false;