From e5c470d5e487b686dbb8581a709f6140eb00cc27 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 20 Jun 2002 16:38:16 +0000 Subject: [PATCH] realtime should not be affected by pause and also should not be used for physics and progs, that's what sv.time is for. Things seem to work nicely, including map changing, and this /should/ make long uptime servers work so long as the map gets changes occasionally. --- qw/source/sv_main.c | 10 +++++++--- qw/source/sv_phys.c | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/qw/source/sv_main.c b/qw/source/sv_main.c index a72c852ab..ad86220cc 100644 --- a/qw/source/sv_main.c +++ b/qw/source/sv_main.c @@ -1867,8 +1867,8 @@ SV_Frame (float time) rand (); // decide the simulation time + realtime += time; if (!sv.paused) { - realtime += time; sv.time += time; } // check timeouts @@ -1885,11 +1885,15 @@ SV_Frame (float time) static double old_time; // don't bother running a frame if sys_ticrate seconds haven't passed - sv_frametime = realtime - old_time; + sv_frametime = sv.time - old_time; + if (sv_frametime < 0) { + old_time = sv.time - sv_mintic->value; + sv_frametime = sv_mintic->value; + } if (sv_frametime >= sv_mintic->value) { if (sv_frametime > sv_maxtic->value) sv_frametime = sv_maxtic->value; - old_time = realtime; + old_time = sv.time; *sv_globals.frametime = sv_frametime; diff --git a/qw/source/sv_phys.c b/qw/source/sv_phys.c index 0d2a7c074..7651ac6ed 100644 --- a/qw/source/sv_phys.c +++ b/qw/source/sv_phys.c @@ -738,9 +738,9 @@ void SV_RunEntity (edict_t *ent) { if (sv_fields.lastruntime != -1) { - if (SVfloat (ent, lastruntime) == (float) realtime) + if (SVfloat (ent, lastruntime) == (float) sv.time) return; - SVfloat (ent, lastruntime) = (float) realtime; + SVfloat (ent, lastruntime) = (float) sv.time; } switch ((int) SVfloat (ent, movetype)) {