summaryrefslogtreecommitdiff
path: root/source/cl_main.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2007-12-07 17:29:24 +0000
committerAndrey Nazarov <skuller@skuller.net>2007-12-07 17:29:24 +0000
commit439dd89a479e2d02fa40a421849c73616f92198e (patch)
tree96731a474ea0198a611f5fa03bcb360119d212a2 /source/cl_main.c
parent5c30b8152eb6a0fae6e50dbd834d73a2846df4ec (diff)
Optimized FS_ListFiles (and broken Windows build).
Initial changes to demo browser to support caching.
Diffstat (limited to 'source/cl_main.c')
-rw-r--r--source/cl_main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/cl_main.c b/source/cl_main.c
index 38116e1..71f6ebc 100644
--- a/source/cl_main.c
+++ b/source/cl_main.c
@@ -2428,7 +2428,7 @@ static void CL_MeasureStats( void ) {
if( cls.netchan ) {
int ack = cls.netchan->incoming_acknowledged;
int ping = 0;
- int i, j;
+ int i, j, k = 0;
i = ack - 16 + 1;
if( i < cl.initialSeq ) {
@@ -2438,12 +2438,11 @@ static void CL_MeasureStats( void ) {
client_history_t *h = &cl.history[j & CMD_MASK];
if( h->rcvd > h->sent ) {
ping += h->rcvd - h->sent;
+ k++;
}
}
- if( j != i ) {
- cls.ping = ping / ( j - i );
- }
+ cls.ping = k ? ping / k : 0;
}
cls.measureTime = time;