This hack makes realtime get reset on map load (in sv_init.c, set to 0)

and also prevents old_time in sv_main.c from getting screwed up in the head
and pausing the physics indefinitely (check and see if there is a faster way
to do it :)

What does this let us do? LEAVE THE SERVER RUNNING! Imprecision due to the
server being on for long periods of time should now no longer be a problem,
so long as you have a map rotation going at least once a day. :)

I plan on committing updated versions of my glspeed cfgs next, and then
looking at timeleft - just to make sure when sys_dead_sleep is 1 it can't
overflow accidentally.

Tim McGrath (Misty)
This commit is contained in:
Timothy C. McGrath 2002-05-25 21:54:41 +00:00
parent ddd96312b1
commit 8ebd2c6243
2 changed files with 6 additions and 3 deletions

View file

@ -353,7 +353,9 @@ SV_SpawnServer (const char *server)
}
sv.time = 1.0;
// Misty HACKHACKHACK
realtime = 0;
strncpy (sv.name, server, sizeof (sv.name));
snprintf (sv.modelname, sizeof (sv.modelname), "maps/%s.bsp", server);
sv.worldmodel = Mod_ForName (sv.modelname, true);

View file

@ -1887,14 +1887,15 @@ SV_Frame (float time)
// don't bother running a frame if sys_ticrate seconds haven't passed
sv_frametime = realtime - old_time;
if (sv_frametime >= sv_mintic->value) {
if (sv_frametime > sv_maxtic->value)
if ((sv_frametime >= sv_mintic->value) || (sv_frametime <= 0)) {
if ((sv_frametime > sv_maxtic->value) || (sv_frametime <= 0)) {
sv_frametime = sv_maxtic->value;
old_time = realtime;
*sv_globals.frametime = sv_frametime;
SV_Physics ();
}
}
}