]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix a bug in EntityFrame5 stats delta bits handling
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 26 Jun 2011 19:50:50 +0000 (19:50 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 26 Jun 2011 19:56:38 +0000 (21:56 +0200)
It forgot to memset the stats delta bits to 0, so it marked stats as being sent
in the database that were not. This clearly caused too large resend data when
packet loss occurred.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11219 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=bbfa614b656aa345e70174b6fdccd1804ca42fb6

protocol.c

index c263d2d3c16b364c83eeabac66ca85584ed110f1..304a2d6155bff858390a52480b0bff035f1e6280 100644 (file)
@@ -2856,6 +2856,7 @@ qboolean EntityFrame5_WriteFrame(sizebuf_t *msg, int maxsize, entityframe5_datab
                                        packetlog = d->packetlog + packetlognumber;
                                        packetlog->packetnumber = framenum;
                                        packetlog->numstates = 0;
+                                       memset(packetlog->statsdeltabits, 0, sizeof(packetlog->statsdeltabits));
                                }
                                packetlog->statsdeltabits[i>>3] |= (1<<(i&7));
                                if (host_client->stats[i] >= 0 && host_client->stats[i] < 256)
@@ -2886,6 +2887,7 @@ qboolean EntityFrame5_WriteFrame(sizebuf_t *msg, int maxsize, entityframe5_datab
                packetlog = d->packetlog + packetlognumber;
                packetlog->packetnumber = framenum;
                packetlog->numstates = 0;
+               memset(packetlog->statsdeltabits, 0, sizeof(packetlog->statsdeltabits));
        }
 
        // write state updates