]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_part.c
***map loader generates portals for the map*** (can you tell this is a big deal? :)
[xonotic/darkplaces.git] / r_part.c
index ed53ba2cfe8f0df1cbd8faaf1edb0d2f88d72210..fff8f378d92a76098bb53acc7ee8b4ef55239939 100644 (file)
--- a/r_part.c
+++ b/r_part.c
@@ -1350,6 +1350,7 @@ void R_DrawParticles (void)
        float                   scale, scale2, minparticledist;
        byte                    *color24;
        vec3_t                  uprightangles, up2, right2, tempcolor, corner;
+       mleaf_t                 *leaf;
 
        // LordHavoc: early out condition
        if ((!numparticles) || (!r_drawparticles.value))
@@ -1377,6 +1378,11 @@ void R_DrawParticles (void)
                if (DotProduct(p->org, vpn) < minparticledist)
                        continue;
 
+               // LordHavoc: check if it's in a visible leaf
+               leaf = Mod_PointInLeaf(p->org, cl.worldmodel);
+               if (leaf->visframe != r_framecount)
+                       continue;
+
                /*
                if (p->type == pt_decal)
                {