aboutsummaryrefslogtreecommitdiffstats
path: root/code/client/cl_main.c
diff options
context:
space:
mode:
authorthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-08-26 01:45:27 +0000
committerthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-08-26 01:45:27 +0000
commit30a33db828a79bd9984dc2ae950c16839b8f07dc (patch)
treed061738b54e7e0b6cee7dd7153ee5864cba09999 /code/client/cl_main.c
parenta9a340054c32478cf49294e33a1877b083085c01 (diff)
downloadioquake3-aero-30a33db828a79bd9984dc2ae950c16839b8f07dc.tar.gz
ioquake3-aero-30a33db828a79bd9984dc2ae950c16839b8f07dc.zip
- compensate sv_fps for timescale value.
- Add a non-dirty-hack fix for client hanging when unpausing a game. git-svn-id: svn://svn.icculus.org/quake3/trunk@870 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/client/cl_main.c')
-rw-r--r--code/client/cl_main.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/code/client/cl_main.c b/code/client/cl_main.c
index 8c89d54..2df8cb1 100644
--- a/code/client/cl_main.c
+++ b/code/client/cl_main.c
@@ -1961,7 +1961,7 @@ void CL_CheckTimeout( void ) {
//
// check timeout
//
- if ( ( !cl_paused->integer || !sv_paused->integer )
+ if ( ( !CL_CheckPaused() || !sv_paused->integer )
&& cls.state >= CA_CONNECTED && cls.state != CA_CINEMATIC
&& cls.realtime - clc.lastPacketTime > cl_timeout->value*1000) {
if (++cl.timeoutcount > 5) { // timeoutcount saves debugger
@@ -1974,6 +1974,22 @@ void CL_CheckTimeout( void ) {
}
}
+/*
+==================
+CL_CheckPaused
+Check whether client has been paused.
+==================
+*/
+qboolean CL_CheckPaused(void)
+{
+ // if cl_paused->modified is set, the cvar has only been changed in
+ // this frame. Keep paused in this frame to ensure the server doesn't
+ // lag behind.
+ if(cl_paused->integer || cl_paused->modified)
+ return qtrue;
+
+ return qfalse;
+}
//============================================================================
@@ -1985,19 +2001,19 @@ CL_CheckUserinfo
*/
void CL_CheckUserinfo( void ) {
// don't add reliable commands when not yet connected
- if ( cls.state < CA_CHALLENGING ) {
+ if(cls.state < CA_CHALLENGING)
return;
- }
+
// don't overflow the reliable command buffer when paused
- if ( cl_paused->integer ) {
+ if(CL_CheckPaused())
return;
- }
+
// send a reliable userinfo update if needed
- if ( cvar_modifiedFlags & CVAR_USERINFO ) {
+ if(cvar_modifiedFlags & CVAR_USERINFO)
+ {
cvar_modifiedFlags &= ~CVAR_USERINFO;
CL_AddReliableCommand( va("userinfo \"%s\"", Cvar_InfoString( CVAR_USERINFO ) ) );
}
-
}
/*