I figured out why realtime 0 caused progs to crash }:) ph33r me. Or

not. Your choice.

if sv_frametime is less than or equal to zero, progs does not enjoy life.
Don't make progs suicide, join the > 0 club today!

Tim McGrath (Misty)
This commit is contained in:
Timothy C. McGrath 2002-06-06 00:32:04 +00:00
parent 46949068a2
commit 25ec0b8efd
2 changed files with 17 additions and 9 deletions

View file

@ -331,6 +331,9 @@ SV_SpawnServer (const char *server)
strcpy (sv.name, server); strcpy (sv.name, server);
// Misty: What, me worry? (Yes, it's BAAAACK) HACKHACKHACK
realtime = 0.1;
// load progs to get entity field count which determines how big each // load progs to get entity field count which determines how big each
// edict is // edict is
SV_LoadProgs (); SV_LoadProgs ();

View file

@ -1885,20 +1885,25 @@ SV_Frame (float time)
if (!sv.paused) { if (!sv.paused) {
static double old_time; static double old_time;
// Misty: Make sure we don't set sv_frametime to 0 or less than 0.
// Progs HATES it when we do that.
if (realtime - old_time > 0) {
// don't bother running a frame if sys_ticrate seconds haven't passed // don't bother running a frame if sys_ticrate seconds haven't passed
sv_frametime = realtime - old_time; sv_frametime = realtime - old_time;
if (sv_frametime >= sv_mintic->value) { if (sv_frametime >= sv_mintic->value) {
if (sv_frametime > sv_maxtic->value) { if (sv_frametime > sv_maxtic->value) {
sv_frametime = sv_maxtic->value; sv_frametime = sv_maxtic->value;
}
old_time = realtime;
*sv_globals.frametime = sv_frametime;
SV_Physics ();
} }
} else {
old_time = realtime; old_time = realtime;
*sv_globals.frametime = sv_frametime;
SV_Physics ();
} }
} }
// get packets // get packets
SV_ReadPackets (); SV_ReadPackets ();