From b5c4866706dbc09645112ea91e2227b1b5c56dc0 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Wed, 6 Mar 2019 21:30:39 -0600 Subject: [PATCH] Add -remove option to joinpassword --- src/d_netcmd.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index a8014ec4..70e6098d 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3797,12 +3797,20 @@ static void Command_ChangeJoinPassword_f(void) if (COM_Argc() != 2) { - CONS_Printf(M_GetText("joinpassword : set a password to join the server\n")); + CONS_Printf(M_GetText("joinpassword : set a password to join the server\nUse -remove to disable the password.\n")); return; } - D_SetJoinPassword(COM_Argv(1)); - CONS_Printf(M_GetText("Join password set.\n")); + if (strcmp(COM_Argv(1), "-remove") == 0) + { + joinpasswordset = false; + CONS_Printf(M_GetText("Join password removed.\n")); + } + else + { + D_SetJoinPassword(COM_Argv(1)); + CONS_Printf(M_GetText("Join password set.\n")); + } #endif }