diff --git a/source/src/client.cpp b/source/src/client.cpp index b7324cf1..6dd897ff 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -251,6 +251,15 @@ 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; + + laststate = player1->state; + ENetPacket *packet = enet_packet_create(NULL, 100, 0); ucharbuf q(packet->data, packet->dataLength); @@ -273,7 +282,7 @@ void c2sinfo(playerent *d) // send update to the server sendpackettoserv(0, packet); bool serveriteminitdone = false; - if(gun_changed || senditemstoserver || !c2sinit || messages.length() || lastmillis-lastping>250) + if(hasmsg) { packet = enet_packet_create (NULL, MAXTRANS, 0); ucharbuf p(packet->data, packet->dataLength); diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 37745234..63df099e 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -94,7 +94,7 @@ void parsepositions(ucharbuf &p) f >>= 3; d->onladder = f&1; if(!demoplayback) updatepos(d); - updatelagtime(d); + if(d->state!=CS_DEAD) updatelagtime(d); break; }