git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4734
d7cf8633-e32d-0410-b094-
e92efae38249
*/
void Host_ServerFrame (void)
{
*/
void Host_ServerFrame (void)
{
+ // never run more than 20 frames at a time as a sanity limit
+ int framecount, framelimit = 20;
double advancetime;
static double frametimetotal = 0, lastservertime = 0;
frametimetotal += host_frametime;
double advancetime;
static double frametimetotal = 0, lastservertime = 0;
frametimetotal += host_frametime;
// run the world state
// don't allow simulation to run too fast or too slow or logic glitches can occur
// run the world state
// don't allow simulation to run too fast or too slow or logic glitches can occur
- while (frametimetotal > 0)
+ for (framecount = 0;framecount < framelimit && frametimetotal > 0;framecount++, frametimetotal -= advancetime)
{
advancetime = min(frametimetotal, sys_ticrate.value);
{
advancetime = min(frametimetotal, sys_ticrate.value);
- frametimetotal = frametimetotal - advancetime;
// only advance time if not paused
// the game also pauses in singleplayer when menu or console is used
// only advance time if not paused
// the game also pauses in singleplayer when menu or console is used