From 08ffc79b5c32fce9bf9db45a5f255f1d189252d2 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Sun, 30 Apr 2023 19:05:29 -0700 Subject: [PATCH] PT_SAY: Review fixup --- src/d_clisrv.c | 5 ++--- src/hu_stuff.c | 4 ---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index aa0be37cb..aa9ff8caa 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4991,14 +4991,13 @@ static void PT_Say(int node) stop_spamming[say.source] = 4; serverplayer_t *stats = SV_GetStatsByPlayerIndex(say.source); - int remainingGames = cv_gamestochat.value - stats->finishedrounds; - if (remainingGames > 0 && !(IsPlayerAdmin(say.source))) + if (stats->finishedrounds < (uint32_t)cv_gamestochat.value && !(IsPlayerAdmin(say.source))) { CONS_Debug(DBG_NETPLAY,"Received SAY cmd from Player %d (%s), but they aren't permitted to chat yet.\n", say.source+1, player_names[say.source]); char rejectmsg[256]; - strlcpy(rejectmsg, va("Please finish in %d more games to use chat.", remainingGames), 256); + strlcpy(rejectmsg, va("Please finish in %d more games to use chat.", cv_gamestochat.value - stats->finishedrounds), 256); if (IsPlayerGuest(say.source)) strlcpy(rejectmsg, va("GUESTs can't chat on this server. Rejoin with a profile to track your playtime."), 256); SendServerNotice(say.source, rejectmsg); diff --git a/src/hu_stuff.c b/src/hu_stuff.c index ce448f651..9c1b213c5 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -628,7 +628,6 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) char *msg; boolean action = false; char *ptr; - INT32 spam_eatmsg = 0; CONS_Debug(DBG_NETPLAY,"Received SAY cmd from Player %d (%s)\n", playernum+1, player_names[playernum]); @@ -658,9 +657,6 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) } } - if (spam_eatmsg) - return; - // If it's a CSAY, just CECHO and be done with it. if (flags & HU_CSAY) {