Add -remove option to joinpassword

This commit is contained in:
fickleheart 2019-03-06 21:30:39 -06:00
parent 264454ca70
commit b5c4866706
1 changed files with 11 additions and 3 deletions

View File

@ -3797,12 +3797,20 @@ static void Command_ChangeJoinPassword_f(void)
if (COM_Argc() != 2)
{
CONS_Printf(M_GetText("joinpassword <password>: set a password to join the server\n"));
CONS_Printf(M_GetText("joinpassword <password>: 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
}