fix an out-by-one error

This commit is contained in:
Bill Currie 2003-03-17 00:52:16 +00:00
parent 2173151560
commit 3a85d98f83

View file

@ -391,7 +391,7 @@ ClusterFlow (int clusternum)
totalvis += numvis; totalvis += numvis;
i = CompressRow (outbuffer, compressed); i = CompressRow (outbuffer, compressed);
cluster->visofs = visdata->size; cluster->visofs = visdata->size;
dstring_append (visdata, compressed, i); dstring_append (visdata, compressed, i);
} }
@ -464,7 +464,7 @@ CalcVis (void)
ClusterFlow (i); ClusterFlow (i);
for (i = 0; i < numrealleafs; i++) { for (i = 0; i < numrealleafs; i++) {
bsp->leafs[i].visofs = clusters[leafcluster[i]].visofs; bsp->leafs[i + 1].visofs = clusters[leafcluster[i]].visofs;
} }
if (options.verbosity >= 0) if (options.verbosity >= 0)
printf ("average clusters visible: %i\n", totalvis / portalclusters); printf ("average clusters visible: %i\n", totalvis / portalclusters);