... d r e d g e ...
Great idea. It could go one more step and freeze all physics except player. Here's the concept--
Create 'sv_freezephysics' cvar. It should be treated as a cheat if sv_cheats is supported.
_Host_Frame: Don't let lights decay
Code: Select all
if (!sv_freezephysics.value || !sv_cheats.value)
CL_DecayLights ();
R_Push_Dlights: Don't kill off dynamic lights
Code: Select all
if ((l->die < cl.time && (!sv_freezephysics.value || !sv_cheats.value)) || (l->radius <= 0))
continue;
R_DrawParticles: Freeze particle motion and deny decay (decay catches up after unfreeze).
Code: Select all
if (!sv_freezephysics.value || !sv_cheats.value) //qb
for ( ;; )
{
kill = active_particles;
...
for (p=active_particles ; p ; p=p->next)
{
if (!sv_freezephysics.value || !sv_cheats.value) //qb
for ( ;; )
{
kill = p->next;
if (kill && kill->die < cl.time)
...
if (!sv_freezephysics.value || !sv_cheats.value)
{
p->org[0] += p->vel[0] * frametime;
SV_Physics: Your engine may use a switch statement, or if-else:
Code: Select all
if (i > 0 && i <= svs.maxclients)
{
SV_Physics_Client (ent, i);
}
else if (!sv_freezephysics.value || !sv_cheats.value) //freeze everything but players
switch ((int) ent->v.movetype)
{
case MOVETYPE_PUSH:
SV_Physics_Pusher (ent);
break;
...