fix somes things

This commit is contained in:
Fangh 2024-01-28 16:52:13 +01:00
parent 1a724ac03c
commit 0014a2a05d
2 changed files with 13 additions and 7 deletions

View File

@ -428,7 +428,7 @@ private void CheckPlayersPropositions()
{ {
if (string.IsNullOrEmpty(p.photoUrl)) if (string.IsNullOrEmpty(p.photoUrl))
{ {
Debug.Log($"player {p.owner} has a proposition without an URL"); Debug.Log($"player {p.owner.name} has a proposition without an URL");
allPlayersHasProposedTwoPictures = false; allPlayersHasProposedTwoPictures = false;
} }
} }

View File

@ -133,16 +133,21 @@ private void UpdateVoters()
if (currentQuestion.propositions[0] != null) if (currentQuestion.propositions[0] != null)
{ {
List<Player> playersThatHasVotedForFirstProposition = new List<Player>(); List<Player> playersThatHasVotedForFirstProposition = new List<Player>();
if (currentQuestion.propositions[0].voters != null)
{
foreach (string playerId in currentQuestion.propositions[0].voters) foreach (string playerId in currentQuestion.propositions[0].voters)
{ {
playersThatHasVotedForFirstProposition.Add(currentPlayers[playerId]); playersThatHasVotedForFirstProposition.Add(currentPlayers[playerId]);
} }
proposition1.UpdateVoters(playersThatHasVotedForFirstProposition); proposition1.UpdateVoters(playersThatHasVotedForFirstProposition);
} }
}
if (currentQuestion.propositions[1] != null) if (currentQuestion.propositions[1] != null)
{ {
List<Player> playersThatHasVotedForSecondProposition = new List<Player>(); List<Player> playersThatHasVotedForSecondProposition = new List<Player>();
if (currentQuestion.propositions[0].voters != null)
{
foreach (string playerId in currentQuestion.propositions[1].voters) foreach (string playerId in currentQuestion.propositions[1].voters)
{ {
playersThatHasVotedForSecondProposition.Add(currentPlayers[playerId]); playersThatHasVotedForSecondProposition.Add(currentPlayers[playerId]);
@ -150,4 +155,5 @@ private void UpdateVoters()
proposition2.UpdateVoters(playersThatHasVotedForSecondProposition); proposition2.UpdateVoters(playersThatHasVotedForSecondProposition);
} }
} }
}
} }