]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rsurf.c
fixed bug in portal culling code that allowed a leaf to be revisited multiple times...
[xonotic/darkplaces.git] / gl_rsurf.c
index 3c8302ec08eae5ea980de3128cccff405b3eb94e..d8e16f95364fe8be3d7c70606c6261b1df65c78d 100644 (file)
@@ -472,8 +472,10 @@ void R_View_WorldVisibility(void)
                        leafstackpos = 1;
                        while (leafstackpos)
                        {
-                               r_refdef.stats.world_leafs++;
                                leaf = leafstack[--leafstackpos];
+                               if (r_viewcache.world_leafvisible[leaf - model->brush.data_leafs])
+                                       continue;
+                               r_refdef.stats.world_leafs++;
                                r_viewcache.world_leafvisible[leaf - model->brush.data_leafs] = true;
                                // mark any surfaces bounding this leaf
                                if (leaf->numleafsurfaces)