From bc647657f4f1df03bf3a33d5c8cf1a4ab5ac719c Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 9 Mar 2019 17:06:44 -0600 Subject: [PATCH] Fix password auto-hiding if you type into it --- src/command.c | 3 ++- src/command.h | 3 ++- src/d_clisrv.c | 6 ------ src/d_netcmd.c | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/command.c b/src/command.c index bb2ea86e6..a5d45bc1e 100644 --- a/src/command.c +++ b/src/command.c @@ -1254,7 +1254,8 @@ found: var->string = var->zstring = Z_StrDup(valstr); - if (override) + if (var->flags & CV_PASSWORD); // Don't change value for password field + else if (override) var->value = overrideval; else if (var->flags & CV_FLOAT) { diff --git a/src/command.h b/src/command.h index 82dfaf8aa..f9d177e2e 100644 --- a/src/command.h +++ b/src/command.h @@ -95,7 +95,8 @@ typedef enum CV_HIDEN = 1024, // variable is not part of the cvar list so cannot be accessed by the console // can only be set when we have the pointer to it // used on menus - CV_CHEAT = 2048 // Don't let this be used in multiplayer unless cheats are on. + CV_CHEAT = 2048, // Don't let this be used in multiplayer unless cheats are on. + CV_PASSWORD = 4096 // Password field } cvflags_t; typedef struct CV_PossibleValue_s diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 6d139114d..087886133 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2173,12 +2173,6 @@ boolean CL_Responder(event_t *ev) ch = (INT32)ev->data1; - if (ch == KEY_CAPSLOCK) // it's a toggle. - { - capslock = !capslock; - return true; - } - // Only ESC and non-keyboard keys abort connection if (ch == KEY_ESCAPE || ch >= KEY_MOUSE1) { diff --git a/src/d_netcmd.c b/src/d_netcmd.c index abc319498..1f75a3bfe 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3707,7 +3707,7 @@ static void Got_Removal(UINT8 **cp, INT32 playernum) } // Join password stuff -consvar_t cv_dummyjoinpassword = {"dummyjoinpassword", "", CV_HIDEN|CV_NOSHOWHELP, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_dummyjoinpassword = {"dummyjoinpassword", "", CV_HIDEN|CV_NOSHOWHELP|CV_PASSWORD, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; #define NUMJOINCHALLENGES 32 static UINT8 joinpassmd5[MD5_LEN+1];