feat: cannot play under 3 players

This commit is contained in:
Fangh 2024-02-01 22:57:10 +01:00
parent a1dd3f0151
commit db56c69dd9

View File

@ -317,11 +317,13 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
{
case (int)GameState.WaitingForOtherPlayersToJoin:
{
if(CheckIfIAmTheFirst(myRoom.GetPlayerList()))
List<Player> players = myRoom.GetOrderedPlayerList();
UpdateDisplayedListUser(players);
if (players.Count >= 3 && CheckIfIAmTheFirst(players))
{
submitStartGame.SetActive(true);
}
UpdateDisplayedListUser(myRoom.GetOrderedPlayerList());
break;
}
default:
@ -509,13 +511,18 @@ private void OnCurrentQuestionChanged(object sender, ValueChangedEventArgs onlin
Question q = myRoom.questions[questionId];
if (WaitingOtherPlayers.activeInHierarchy)
//do not vote for your question
if(myRoom.GetQuestionsByPlayer(currentPlayer).Contains(q))
{
WaitingOtherPlayers.SetActive(false);
VotePicture.SetActive(true);
WaitingOtherPlayers.SetActive(true);
VotePicture.SetActive(false);
}
else
{
VotePicture.SetActive(true);
WaitingOtherPlayers.SetActive(false);
VotePicture.GetComponent<PropositionHandler>().ShowQuestion(q);
}
VotePicture.GetComponent<PropositionHandler>().ShowQuestion(q);
}
/// <summary>