mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-30 08:00:51 +00:00
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.
This commit is contained in:
parent
7ab3095024
commit
e5c470d5e4
2 changed files with 9 additions and 5 deletions
|
@ -1867,8 +1867,8 @@ SV_Frame (float time)
|
|||
rand ();
|
||||
|
||||
// decide the simulation time
|
||||
if (!sv.paused) {
|
||||
realtime += time;
|
||||
if (!sv.paused) {
|
||||
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;
|
||||
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue