From f4853de69120baaa72bb554440f1874cf3c4818c Mon Sep 17 00:00:00 2001 From: stevenaaus Date: Fri, 10 Jun 2011 03:04:51 +0000 Subject: [PATCH] Trial a new Freeze cvar. git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@457 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/sv_main.c | 2 ++ Quake/sv_phys.c | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Quake/sv_main.c b/Quake/sv_main.c index b76f5a87..4947293f 100644 --- a/Quake/sv_main.c +++ b/Quake/sv_main.c @@ -78,6 +78,7 @@ void SV_Init (void) extern cvar_t sv_maxvelocity; extern cvar_t sv_gravity; extern cvar_t sv_nostep; + extern cvar_t sv_freezenonclients; extern cvar_t sv_friction; extern cvar_t sv_edgefriction; extern cvar_t sv_stopspeed; @@ -97,6 +98,7 @@ void SV_Init (void) Cvar_RegisterVariable (&sv_idealpitchscale, NULL); Cvar_RegisterVariable (&sv_aim, NULL); Cvar_RegisterVariable (&sv_nostep, NULL); + Cvar_RegisterVariable (&sv_freezenonclients, NULL); Cvar_RegisterVariable (&sv_altnoclip, NULL); //johnfitz Cmd_AddCommand ("sv_protocol", &SV_Protocol_f); //johnfitz diff --git a/Quake/sv_phys.c b/Quake/sv_phys.c index a699d553..06dbb164 100644 --- a/Quake/sv_phys.c +++ b/Quake/sv_phys.c @@ -45,6 +45,8 @@ cvar_t sv_stopspeed = {"sv_stopspeed","100"}; cvar_t sv_gravity = {"sv_gravity","800",false,true}; cvar_t sv_maxvelocity = {"sv_maxvelocity","2000"}; cvar_t sv_nostep = {"sv_nostep","0"}; +cvar_t sv_freezenonclients = {"sv_freezenonclients","0"}; + #define MOVE_EPSILON 0.01 @@ -1169,7 +1171,8 @@ SV_Physics */ void SV_Physics (void) { - int i; + int i; + int entity_cap; // For sv_freezenonclients edict_t *ent; // let the progs know that a new frame has started @@ -1184,7 +1187,14 @@ void SV_Physics (void) // treat each object in turn // ent = sv.edicts; - for (i=0 ; ifree) continue; @@ -1216,5 +1226,6 @@ void SV_Physics (void) if (pr_global_struct->force_retouch) pr_global_struct->force_retouch--; - sv.time += host_frametime; + if (!sv_freezenonclients.value) + sv.time += host_frametime; }