From 198d9f5d5e59d7c4f231d4df32bf264ca58b0cbf Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 4 Jun 2007 10:38:11 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1121 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/client.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/src/client.cpp b/source/src/client.cpp index 6dd897ff..d2f0c530 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -231,7 +231,7 @@ void addmsg(int type, const char *fmt, ...) loopi(len) messages.add(buf[i]); } -int lastupdate = 0, lastping = 0; +static int lastupdate = 0, lastping = 0, laststate = -1; bool senditemstoserver = false; // after a map change, since server doesn't have map data void sendpackettoserv(int chan, ENetPacket *packet) @@ -252,11 +252,9 @@ void c2sinfo(playerent *d) // send update to the server if(d->clientnum<0) return; // we haven't had a welcome message from the server yet if(lastmillis-lastupdate<40) return; // don't update faster than 25fps - static int laststate = -1; - bool hasmsg = gun_changed || senditemstoserver || !c2sinit || messages.length() || lastmillis-lastping>250; - // limit updates to 4fps for dead players - if(!hasmsg && laststate==CS_DEAD && player1->state==CS_DEAD && lastmillis-lastupdate<250) return; + // limit updates for dead players to the ping rate of 4fps, as above + if(!hasmsg && laststate==CS_DEAD && player1->state==CS_DEAD) return; laststate = player1->state;