]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
don't send entities outside addressable origin range (+-32767)
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 4 Mar 2002 11:08:20 +0000 (11:08 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 4 Mar 2002 11:08:20 +0000 (11:08 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1606 d7cf8633-e32d-0410-b094-e92efae38249

sv_main.c

index a335a7f9f6e171f1673063b93c0520c25dfc6a4e..5e886884e58078a6e9e3c750982827221cc63add 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -961,6 +961,10 @@ void SV_WriteEntitiesToClient (client_t *client, edict_t *clent, sizebuf_t *msg)
                        VectorCopy(ent->v.origin, origin);
                }
 
+               // don't send an entity if it's coordinates would wrap around
+               if (origin[0] < -32768 || origin[1] < -32768 || origin[2] < -32768 || origin[0] > 32767 || origin[1] > 32767 || origin[2] > 32767)
+                       continue;
+
                // ent has survived every check so far, check if it is visible
                // always send embedded brush models, they don't generate much traffic
                if (ent != clent && ((flags & RENDER_VIEWMODEL) == 0) && (model == NULL || model->type != mod_brush || model->name[0] != '*'))
@@ -1791,6 +1795,7 @@ void SV_SpawnServer (char *server)
 // run two frames to allow everything to settle
        sv.frametime = pr_global_struct->frametime = host_frametime = 0.1;
        SV_Physics ();
+       sv.frametime = pr_global_struct->frametime = host_frametime = 0.1;
        SV_Physics ();
 
        Mod_PurgeUnused();