Check target < MAXPLAYERS before PM

This commit is contained in:
mazmazz 2018-12-23 02:25:58 -05:00
parent a9fb17dab1
commit 6ebc41a554

View file

@ -490,7 +490,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags)
//CONS_Printf("%d\n", target); //CONS_Printf("%d\n", target);
// check for target player, if it doesn't exist then we can't send the message! // check for target player, if it doesn't exist then we can't send the message!
if (playeringame[target]) // player exists if (target < MAXPLAYERS && playeringame[target]) // player exists
target++; // even though playernums are from 0 to 31, target is 1 to 32, so up that by 1 to have it work! target++; // even though playernums are from 0 to 31, target is 1 to 32, so up that by 1 to have it work!
else else
{ {
@ -1014,7 +1014,7 @@ static void HU_queueChatChar(char c)
//CONS_Printf("%d\n", target); //CONS_Printf("%d\n", target);
// check for target player, if it doesn't exist then we can't send the message! // check for target player, if it doesn't exist then we can't send the message!
if (playeringame[target]) // player exists if (target < MAXPLAYERS && playeringame[target]) // player exists
target++; // even though playernums are from 0 to 31, target is 1 to 32, so up that by 1 to have it work! target++; // even though playernums are from 0 to 31, target is 1 to 32, so up that by 1 to have it work!
else else
{ {