From f3ca6eb9b0a00a0eed5753a2966efa86516d6e0f Mon Sep 17 00:00:00 2001 From: Abhisha Nirmalathas <a.nirmalathas1@student.unimelb.edu.au> Date: Tue, 23 Apr 2019 11:33:28 +1000 Subject: [PATCH] ensuring cleared cookies edge case hadnlign pt 2 --- user.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/user.c b/user.c index 800fafd..edbaa3d 100644 --- a/user.c +++ b/user.c @@ -11,7 +11,7 @@ #include "user.h" // implementation specific constants for users -#define INITIAL_KEYWORDS 5 +#define INITIAL_KEYWORDS 20 #define INITAL_N_USERS 10 #define INITIAL_KEYWORD_LENGTH 30 @@ -135,16 +135,20 @@ bool players_ready(User_list* user_list){ /** * checks if all players are ready * */ + int count =0; for(int i=0; i < user_list->n_users; i++){ // other player is not ready if (user_list->users[i]->status != READY){ - return false; + count++; } // only one player, need to wait else if (user_list->n_users == 1){ return false; } } + if(count + 1 == user_list->n_users){ + return false; + } return true; } void change_player_status(int user_id, User_list* user_list, STATUS status){ -- GitLab