diff --git a/src/hu_stuff.c b/src/hu_stuff.c index eb2915d801caa69df14f912e772238a57169d3b7..b95eb3e66a29fee6c0f1e7a8774296d6f3b5fe96 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -641,6 +641,8 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) msg = (char *)*p; SKIPSTRINGL(*p, HU_MAXMSGLEN + 1); + // check if player is sending a say command while muted + // or if they are sending a csay and are not an admin if ((cv_mute.value || flags & (HU_CSAY|HU_SERVER_SAY)) && playernum != serverplayer && !(IsPlayerAdmin(playernum))) { CONS_Alert(CONS_WARNING, cv_mute.value ? diff --git a/src/netcode/net_command.c b/src/netcode/net_command.c index 2b3abfd0238a3246fedc086afc007a85c993b425..b321d727bf957f5d3a7769542e0c1a786fe66c21 100644 --- a/src/netcode/net_command.c +++ b/src/netcode/net_command.c @@ -39,7 +39,8 @@ void RegisterNetXCmd(netxcmd_t id, void (*cmd_f)(UINT8 **p, INT32 playernum)) void SendNetXCmd(netxcmd_t id, const void *param, size_t nparam) { - if (localtextcmd[0]+2+nparam > MAXTEXTCMD) + // +1 for the size and another +1 for the ID. + if (localtextcmd[0] + 2 + nparam > MAXTEXTCMD) { // for future reference: if (cv_debug) != debug disabled. CONS_Alert(CONS_ERROR, M_GetText("NetXCmd buffer full, cannot add netcmd %d! (size: %d, needed: %s)\n"), id, localtextcmd[0], sizeu1(nparam)); @@ -57,7 +58,8 @@ void SendNetXCmd(netxcmd_t id, const void *param, size_t nparam) // splitscreen player void SendNetXCmd2(netxcmd_t id, const void *param, size_t nparam) { - if (localtextcmd2[0]+2+nparam > MAXTEXTCMD) + // +1 for the size and another +1 for the ID. + if (localtextcmd2[0] + 2 + nparam > MAXTEXTCMD) { I_Error("No more place in the buffer for netcmd %d\n",id); return;