]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rsurf.c
gl_rsurf: Actually use the model pointer
[xonotic/darkplaces.git] / gl_rsurf.c
index e47becbfccc63f12ab08a4eb4d1343e464df1ff7..a832e4fa3cbc6d5f355574750c83a56b1fd68f06 100644 (file)
@@ -386,12 +386,12 @@ void R_DrawPortals(void)
        model_t *model = r_refdef.scene.worldmodel;
        if (model == NULL)
                return;
-       for (leafnum = 0;leafnum < r_refdef.scene.worldmodel->brush.num_leafs;leafnum++)
+       for (leafnum = 0;leafnum < model->brush.num_leafs;leafnum++)
        {
                if (r_refdef.viewcache.world_leafvisible[leafnum])
                {
                        //for (portalnum = 0, portal = model->brush.data_portals;portalnum < model->brush.num_portals;portalnum++, portal++)
-                       for (portal = r_refdef.scene.worldmodel->brush.data_leafs[leafnum].portals;portal;portal = portal->next)
+                       for (portal = model->brush.data_leafs[leafnum].portals;portal;portal = portal->next)
                        {
                                if (portal->numpoints <= POLYGONELEMENTS_MAXPOINTS)
                                if (!R_CullBox(portal->mins, portal->maxs))