Fix confusion between nodes and players in ping updating code and PT_PING packet sending code

This commit is contained in:
Monster Iestyn 2017-06-01 19:01:57 +01:00
parent 2223283208
commit 3d86e7135d
1 changed files with 4 additions and 4 deletions

View File

@ -4529,8 +4529,8 @@ static inline void PingUpdate(void)
}
//send out our ping packets
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i])
for (i = 0; i < MAXNETNODES; i++)
if (nodeingame[i])
HSendPacket(i, true, 0, sizeof(INT32) * MAXPLAYERS);
pingmeasurecount = 1; //Reset count
@ -4571,9 +4571,9 @@ void NetUpdate(void)
if (server)
{
// update node latency values so we can take an average later.
for (i = 0; i < MAXNETNODES; i++)
for (i = 0; i < MAXPLAYERS; i++)
if (playeringame[i])
realpingtable[i] += G_TicsToMilliseconds(GetLag(i));
realpingtable[i] += G_TicsToMilliseconds(GetLag(playernode[i]));
pingmeasurecount++;
}
#endif