made dland2.wav not play in GAME_NEXUIZ
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 15 Apr 2005 08:18:26 +0000 (08:18 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 15 Apr 2005 08:18:26 +0000 (08:18 +0000)
no longer runs physics on disconnected clients (quake did not run them), fixing the physics problems with frikbots, thanks to FrikaC for explanation of this problem

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5181 d7cf8633-e32d-0410-b094-e92efae38249

sv_phys.c

index 59c02e1..8d2dfb0 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -1357,7 +1357,7 @@ void SV_Physics_Step (edict_t *ent)
                SV_LinkEdict(ent, true);
 
                // just hit ground
-               if (hitsound && (int)ent->v->flags & FL_ONGROUND)
+               if (hitsound && (int)ent->v->flags & FL_ONGROUND && gamemode != GAME_NEXUIZ)
                        SV_StartSound(ent, 0, "demon/dland2.wav", 255, 1);
        }
 
@@ -1405,8 +1405,11 @@ void SV_Physics (void)
                if (pr_global_struct->force_retouch)
                        SV_LinkEdict (ent, true);       // force retouch even for stationary
 
-               if (i >= 1 && i <= svs.maxclients && svs.clients[i-1].spawned)
+               if (i >= 1 && i <= svs.maxclients)
                {
+                       // don't do physics on disconnected clients, FrikBot relies on this
+                       if (!svs.clients[i-1].spawned)
+                               continue;
                        // connected slot
                        // call standard client pre-think
                        SV_CheckVelocity (ent);
@@ -1484,7 +1487,7 @@ void SV_Physics (void)
                        break;
                }
 
-               if (i >= 1 && i <= svs.maxclients && svs.clients[i-1].spawned)
+               if (i >= 1 && i <= svs.maxclients)
                {
                        SV_CheckVelocity (ent);