]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fixed bug that called PlayerPreThink and PlayerPostThink on unspawned clients
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 15 Nov 2004 23:09:21 +0000 (23:09 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 15 Nov 2004 23:09:21 +0000 (23:09 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4756 d7cf8633-e32d-0410-b094-e92efae38249

sv_phys.c

index c03cdb26a36ceba9099e45af558718e6fd041e9f..b542783259b080d4e382369ce1640b5e744a0dec 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -1412,18 +1412,15 @@ void SV_Physics (void)
                if (pr_global_struct->force_retouch)
                        SV_LinkEdict (ent, true);       // force retouch even for stationary
 
-               if (i <= svs.maxclients)
+               if (i >= 1 && i <= svs.maxclients && svs.clients[i-1].spawned)
                {
-                       if (i > 0)
-                       {
-                               // 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);
-                       }
+                       // 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)
                        continue;
@@ -1492,7 +1489,7 @@ void SV_Physics (void)
                        break;
                }
 
-               if (i <= svs.maxclients && i > 0 && !ent->e->free)
+               if (i >= 1 && i <= svs.maxclients && svs.clients[i-1].spawned)
                {
                        SV_CheckVelocity (ent);