- r_refdef.stats.world_portals++;
- if (DotProduct(r_refdef.view.origin, p->plane.normal) < (p->plane.dist + 1)
- && !r_refdef.viewcache.world_leafvisible[p->past - model->brush.data_leafs]
- && CHECKPVSBIT(r_refdef.viewcache.world_pvsbits, p->past->clusterindex)
- && !R_CullBox(p->mins, p->maxs)
- && leafstackpos < (int)(sizeof(leafstack) / sizeof(leafstack[0])))
- leafstack[leafstackpos++] = p->past;
+ r_refdef.stats[r_stat_world_portals]++;
+ if (r_refdef.viewcache.world_leafvisible[p->past - model->brush.data_leafs])
+ continue;
+ if (!CHECKPVSBIT(r_refdef.viewcache.world_pvsbits, p->past->clusterindex))
+ continue;
+ cullmins[0] = p->mins[0] - cullbias;
+ cullmins[1] = p->mins[1] - cullbias;
+ cullmins[2] = p->mins[2] - cullbias;
+ cullmaxs[0] = p->maxs[0] + cullbias;
+ cullmaxs[1] = p->maxs[1] + cullbias;
+ cullmaxs[2] = p->maxs[2] + cullbias;
+ if (R_CullBox(cullmins, cullmaxs))
+ continue;
+ if (leafstackpos >= (int)(sizeof(leafstack) / sizeof(leafstack[0])))
+ break;
+ leafstack[leafstackpos++] = p->past;