diff --git a/App/Assets/Scripts/Draggable.cs b/App/Assets/Scripts/Draggable.cs index ec7d6d9ca9c8152002d9e72215d859f72bb4d502..67451e6db027c2f14f94d514959cd7b2327b955b 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 776a196e099727c70b32b0caf8b385a074ad691c..814e0315fda9520fba2c35d56cf53812745d5e93 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); }