diff --git a/code/modules/basketball/controller.dm b/code/modules/basketball/controller.dm index 3fdb746a33e..f5cc286ba2a 100644 --- a/code/modules/basketball/controller.dm +++ b/code/modules/basketball/controller.dm @@ -313,14 +313,15 @@ GLOBAL_VAR(basketball_game) */ /datum/basketball_controller/proc/check_signups() for(var/bad_key in GLOB.basketball_bad_signup) - if(GLOB.directory[bad_key]) //they have reconnected if we can search their key and get a client + var/client/signup_client = GLOB.directory[bad_key] + if(signup_client) //they have reconnected if we can search their key and get a client GLOB.basketball_bad_signup -= bad_key - GLOB.basketball_signup += bad_key + GLOB.basketball_signup[bad_key] = TRUE for(var/key in GLOB.basketball_signup) var/client/signup_client = GLOB.directory[key] if(!signup_client) //vice versa but in a variable we use later GLOB.basketball_signup -= key - GLOB.basketball_bad_signup += key + GLOB.basketball_bad_signup[key] = TRUE continue if(!isobserver(signup_client.mob)) //they are back to playing the game, remove them from the signups @@ -341,6 +342,7 @@ GLOBAL_VAR(basketball_game) return GLOB.always_state /datum/basketball_controller/ui_interact(mob/user, datum/tgui/ui) + check_signups() ui = SStgui.try_update_ui(user, src, ui) if(!ui) ui = new(user, src, "BasketballPanel") @@ -378,11 +380,12 @@ GLOBAL_VAR(basketball_game) switch(action) if("basketball_signup") - if(GLOB.basketball_signup[ghost_client.ckey]) - GLOB.basketball_signup -= ghost_client.ckey // double check this works? + if(GLOB.basketball_signup[ghost_client.ckey] || GLOB.basketball_bad_signup[ghost_client.ckey]) + GLOB.basketball_signup -= ghost_client.ckey + GLOB.basketball_bad_signup -= ghost_client.ckey to_chat(ghost_client, span_notice("You unregister from basketball.")) else - GLOB.basketball_signup[ghost_client.ckey] = ghost_client + GLOB.basketball_signup[ghost_client.ckey] = TRUE to_chat(ghost_client, span_notice("You sign up for basketball.")) check_signups() diff --git a/code/modules/mafia/controller.dm b/code/modules/mafia/controller.dm index 6062aff18fe..0ab3cc49e92 100644 --- a/code/modules/mafia/controller.dm +++ b/code/modules/mafia/controller.dm @@ -624,9 +624,7 @@ for(var/key in GLOB.mafia_signup + GLOB.mafia_bad_signup) var/list/lobby_member = list() lobby_member["name"] = key - lobby_member["status"] = "Ready" - if(key in GLOB.mafia_bad_signup) - lobby_member["status"] = "Disconnected" + lobby_member["status"] = (key in GLOB.mafia_bad_signup) ? "Disconnected" : "Ready" lobby_member["spectating"] = "Ghost" if(key in spectators) lobby_member["spectating"] = "Spectator" @@ -744,7 +742,7 @@ to_chat(usr, span_notice("You unregister from Mafia.")) return TRUE else - GLOB.mafia_signup[C.ckey] = C + GLOB.mafia_signup[C.ckey] = TRUE to_chat(usr, span_notice("You sign up for Mafia.")) if(phase == MAFIA_PHASE_SETUP) check_signups() @@ -1065,12 +1063,12 @@ for(var/bad_key in GLOB.mafia_bad_signup) if(GLOB.directory[bad_key])//they have reconnected if we can search their key and get a client GLOB.mafia_bad_signup -= bad_key - GLOB.mafia_signup += bad_key + GLOB.mafia_signup[bad_key] = TRUE for(var/key in GLOB.mafia_signup) var/client/C = GLOB.directory[key] if(!C)//vice versa but in a variable we use later GLOB.mafia_signup -= key - GLOB.mafia_bad_signup += key + GLOB.mafia_bad_signup[key] = TRUE continue if(!isobserver(C.mob)) //they are back to playing the game, remove them from the signups