Fix buffer overwrite & increment

This commit is contained in:
TehRealSalt 2019-01-16 16:13:34 -05:00
parent 3246ca6b33
commit a5f23091cc
2 changed files with 13 additions and 4 deletions

View file

@ -3389,8 +3389,6 @@ static boolean SV_AddWaitingPlayers(void)
{
INT32 node, n, newplayer = false;
UINT8 newplayernum = 0;
static UINT8 buf[3];
static UINT8 *buf_p = buf;
// What is the reason for this? Why can't newplayernum always be 0?
// Sal: Because the dedicated player is stupidly forced into players[0].....
@ -3402,6 +3400,9 @@ static boolean SV_AddWaitingPlayers(void)
// splitscreen can allow 2+ players in one node
for (; nodewaiting[node] > 0; nodewaiting[node]--)
{
UINT8 buf[3];
UINT8 *buf_p = buf;
newplayer = true;
// search for a free playernum

View file

@ -718,8 +718,16 @@ void Y_Ticker(void)
r++;
data.match.jitter[data.match.num[q]] = 1;
if (--data.match.increase[data.match.num[q]])
kaching = false;
if (data.match.increase[data.match.num[q]] > 0)
{
if (--data.match.increase[data.match.num[q]])
kaching = false;
}
else if (data.match.increase[data.match.num[q]] < 0)
{
if (++data.match.increase[data.match.num[q]])
kaching = false;
}
}
if (r)