From 048ce8496fd2d5d72b04395a098904be2c41a3bc Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 10 Mar 2019 17:36:16 -0500 Subject: [PATCH] Make noises on the password entry screen --- src/d_clisrv.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 01304f38..98330c84 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4001,11 +4001,23 @@ static void HandlePacketFromAwayNode(SINT8 node) cl_mode = CL_CHALLENGE; - if (cl_challengeattempted == 2) + switch (cl_challengeattempted) { - // We already sent a correct password, so throw it back up again. - D_ComputeChallengeAnswer(cl_challengequestion, cl_challengepassword, cl_challengeanswer); - cl_mode = CL_ASKJOIN; + case 2: + // We already sent a correct password, so throw it back up again. + D_ComputeChallengeAnswer(cl_challengequestion, cl_challengepassword, cl_challengeanswer); + cl_mode = CL_ASKJOIN; + break; + + case 1: + // We entered the wrong password! + S_StartSound(NULL, sfx_s26d); + break; + + default: + // First entry to the password screen. + S_StartSound(NULL, sfx_s224); + break; } } break; @@ -4064,6 +4076,9 @@ static void HandlePacketFromAwayNode(SINT8 node) break; } + if (cl_challengeattempted == 1) // Successful password noise. + S_StartSound(NULL, sfx_s221); + cl_challengeattempted = 2; CONS_Printf("trying to download\n"); if (CL_SendRequestFile()) @@ -4085,6 +4100,9 @@ static void HandlePacketFromAwayNode(SINT8 node) if (cl_mode != CL_WAITJOINRESPONSE) break; + if (cl_challengeattempted == 1) // Successful password noise. + S_StartSound(NULL, sfx_s221); + if (client) { maketic = gametic = neededtic = (tic_t)LONG(netbuffer->u.servercfg.gametic);