no missing (black) leaf bug anymore...
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@918
d7cf8633-e32d-0410-b094-
e92efae38249
if (c & bit)
{
leafnum = (k << 3)+i+1;
if (c & bit)
{
leafnum = (k << 3)+i+1;
- if (leafnum >= numleafs)
+ if (leafnum > numleafs)
- leaf = &model->leafs[leafnum];
+ leaf = &model->leafs[i];
if (R_NotCulledBox(leaf->mins, leaf->maxs))
{
//for (portal = leaf->portals;portal;portal = portal->next)
if (R_NotCulledBox(leaf->mins, leaf->maxs))
{
//for (portal = leaf->portals;portal;portal = portal->next)
+ int i, k, m, c, leafnum;
msurface_t *surf, **mark;
mleaf_t *leaf;
byte *in = pvsleaf->compressed_vis;
msurface_t *surf, **mark;
mleaf_t *leaf;
byte *in = pvsleaf->compressed_vis;
- l = model->numleafs - (k << 3);
- if (l > 8)
- l = 8;
- for (i=0 ; i<l ; i++)
- leaf = &model->leafs[(k << 3)+i+1];
+ leafnum = (k << 3)+i+1;
+ if (leafnum > model->numleafs)
+ return;
+ leaf = &model->leafs[leafnum];
// if (leaf->visframe != r_framecount)
// continue;
// if (leaf->contents == CONTENTS_SOLID)
// if (leaf->visframe != r_framecount)
// continue;
// if (leaf->contents == CONTENTS_SOLID)