From 2bdb42192d4a6cbf0d81b1208dbcb4a1b1ce8b9b Mon Sep 17 00:00:00 2001
From: Nongma SORGHO <sorghocharles8@gmail.com>
Date: Sat, 13 May 2023 18:16:31 +0200
Subject: [PATCH] (fix: all) 4 players test

---
 App/Assets/Scripts/Draggable.cs | 2 ++
 App/Assets/Scripts/Joueur.cs    | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/App/Assets/Scripts/Draggable.cs b/App/Assets/Scripts/Draggable.cs
index ec7d6d9ca..67451e6db 100644
--- a/App/Assets/Scripts/Draggable.cs
+++ b/App/Assets/Scripts/Draggable.cs
@@ -75,6 +75,8 @@ public class Draggable : MonoBehaviour
 		// clic sur un pion d'un autre joueur
 		//		Debug.Log("id joueur pion: " + pion.get_ID_joueur() + ", id tour dans client: " + client.get_ID_tour());
 		int idCase;
+
+		if (client.id_Joueur_In_Game - 1 != client.get_ID_tour()) { return; }
 		
 		if (pion.get_ID_joueur() != client.get_ID_tour() + 1)
 		{
diff --git a/App/Assets/Scripts/Joueur.cs b/App/Assets/Scripts/Joueur.cs
index 776a196e0..814e0315f 100644
--- a/App/Assets/Scripts/Joueur.cs
+++ b/App/Assets/Scripts/Joueur.cs
@@ -205,7 +205,7 @@ public class Joueur : MonoBehaviour
 	{
 		// if it is not this player's turn disable the dice button
 		float[] timerInfo = client.getTimerInfo(ID_joueur-1);
-		if (client.id_Joueur_In_Game - 1 != client.get_ID_tour() || hasChosen || timerInfo[0] == 2.0f)
+		if ((client.id_Joueur_In_Game - 1 != client.get_ID_tour() && client.get_ID_tour() + 1 != ID_joueur) || hasChosen || timerInfo[0] == 2.0f)
 		{
 			choiceButton.interactable = false;
 		}
@@ -213,7 +213,7 @@ public class Joueur : MonoBehaviour
 		{
 			choiceButton.interactable = true;
 		}
-		if (client.id_Joueur_In_Game - 1 == client.get_ID_tour() && gameStarted)
+		if (client.id_Joueur_In_Game - 1 == client.get_ID_tour() && gameStarted && client.get_ID_tour() + 1 == ID_joueur)
 		{
 			choiceButton.gameObject.SetActive(true);
 		}
-- 
GitLab