From: divverent Date: Wed, 21 Sep 2011 12:19:06 +0000 (+0000) Subject: prevent recursive invocation of loading screen X-Git-Tag: xonotic-v0.6.0~323 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=deb4b204c98d48874950e47b3b7085c3683515b3;p=xonotic%2Fdarkplaces.git prevent recursive invocation of loading screen when loading the loading screen takes longer than 2 sec git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11364 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=4ceac6f4b1855c06e080e722e6c979ea12bad446 --- diff --git a/cl_parse.c b/cl_parse.c index 3d56d111..460070ca 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -297,6 +297,7 @@ so the server doesn't disconnect. static unsigned char olddata[NET_MAXMESSAGE]; void CL_KeepaliveMessage (qboolean readmessages) { + static qboolean recursive = false; float time; static double nextmsg = -1; static double nextupdate = -1; @@ -307,18 +308,29 @@ void CL_KeepaliveMessage (qboolean readmessages) qboolean oldbadread; sizebuf_t old; - if(cls.state != ca_dedicated) + qboolean thisrecursive; + + thisrecursive = recursive; + recursive = true; + + if(!thisrecursive) { - if((time = Sys_DoubleTime()) >= nextupdate) + if(cls.state != ca_dedicated) { - SCR_UpdateLoadingScreenIfShown(); - nextupdate = time + 2; + if((time = Sys_DoubleTime()) >= nextupdate) + { + SCR_UpdateLoadingScreenIfShown(); + nextupdate = time + 2; + } } } // no need if server is local and definitely not if this is a demo if (!cls.netcon || cls.protocol == PROTOCOL_QUAKEWORLD || cls.signon >= SIGNONS) + { + recursive = thisrecursive; return; + } if (readmessages) { @@ -358,6 +370,8 @@ void CL_KeepaliveMessage (qboolean readmessages) MSG_WriteChar(&msg, clc_nop); NetConn_SendUnreliableMessage(cls.netcon, &msg, cls.protocol, 10000, false); } + + recursive = thisrecursive; } void CL_ParseEntityLump(char *entdata)