]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_phys.c
cleaned up rtlight handling, merging most code between world rtlights and dlights...
[xonotic/darkplaces.git] / sv_phys.c
index e1ef0f96cc3ad79c86990e94b73e6a5ba275881e..66eec8e2fe1fdd61094b74ff6597af0842b40d99 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -703,7 +703,8 @@ void SV_PushMove (edict_t *pusher, float movetime)
                if (check->v->movetype == MOVETYPE_PUSH
                 || check->v->movetype == MOVETYPE_NONE
                 || check->v->movetype == MOVETYPE_FOLLOW
-                || check->v->movetype == MOVETYPE_NOCLIP)
+                || check->v->movetype == MOVETYPE_NOCLIP
+                || check->v->movetype == MOVETYPE_FAKEPUSH)
                        continue;
 
                // if the entity is standing on the pusher, it will definitely be moved
@@ -1287,9 +1288,11 @@ void SV_Physics_Toss (edict_t *ent)
                }
                else if (ent->v->movetype == MOVETYPE_BOUNCE)
                {
+                       float d;
                        ClipVelocity (ent->v->velocity, trace.plane.normal, ent->v->velocity, 1.5);
                        // LordHavoc: fixed grenades not bouncing when fired down a slope
-                       if (trace.plane.normal[2] > 0.7 && DotProduct(trace.plane.normal, ent->v->velocity) < 60)
+                       d = DotProduct(trace.plane.normal, ent->v->velocity);
+                       if (trace.plane.normal[2] > 0.7 && fabs(d) < 60)
                        {
                                ent->v->flags = (int)ent->v->flags | FL_ONGROUND;
                                ent->v->groundentity = EDICT_TO_PROG(trace.ent);
@@ -1391,25 +1394,29 @@ void SV_Physics (void)
                if (pr_global_struct->force_retouch)
                        SV_LinkEdict (ent, true);       // force retouch even for stationary
 
-               if (i <= svs.maxclients && i > 0)
+               if (i <= svs.maxclients)
                {
-                       if (!svs.clients[i-1].spawned)
-                               continue;
-                       // connected slot
-                       // call standard client pre-think
-                       SV_CheckVelocity (ent);
-                       pr_global_struct->time = sv.time;
-                       pr_global_struct->self = EDICT_TO_PROG(ent);
-                       PR_ExecuteProgram (pr_global_struct->PlayerPreThink, "QC function PlayerPreThink is missing");
-                       SV_CheckVelocity (ent);
+                       if (i > 0)
+                       {
+                               if (!svs.clients[i-1].spawned)
+                                       continue;
+                               // connected slot
+                               // call standard client pre-think
+                               SV_CheckVelocity (ent);
+                               pr_global_struct->time = sv.time;
+                               pr_global_struct->self = EDICT_TO_PROG(ent);
+                               PR_ExecuteProgram (pr_global_struct->PlayerPreThink, "QC function PlayerPreThink is missing");
+                               SV_CheckVelocity (ent);
+                       }
                }
                else if (sv_freezenonclients.integer)
-                       break;
+                       continue;
 
                // LordHavoc: merged client and normal entity physics
                switch ((int) ent->v->movetype)
                {
                case MOVETYPE_PUSH:
+               case MOVETYPE_FAKEPUSH:
                        SV_Physics_Pusher (ent);
                        break;
                case MOVETYPE_NONE:
@@ -1469,7 +1476,7 @@ void SV_Physics (void)
                        break;
                }
 
-               if (i > 0 && i <= svs.maxclients && !ent->e->free)
+               if (i <= svs.maxclients && i > 0 && !ent->e->free)
                {
                        SV_CheckVelocity (ent);
 
@@ -1496,7 +1503,8 @@ void SV_Physics (void)
                PR_ExecuteProgram ((func_t)(EndFrameQC - pr_functions), "");
        }
 
-       sv.time += sv.frametime;
+       if (!sv_freezenonclients.integer)
+               sv.time += sv.frametime;
 }