Fix stupid loop iterrator mixup in Mod_CheckWaterVis. Reported by Axel Gneiting.

This commit is contained in:
Shpoike 2022-06-22 06:15:08 +01:00
parent bf20203857
commit 334931c65e

View file

@ -2099,10 +2099,10 @@ void Mod_CheckWaterVis(void)
if ((contenttransparent & (SURF_DRAWWATER|SURF_DRAWTELE))==(SURF_DRAWWATER|SURF_DRAWTELE)) if ((contenttransparent & (SURF_DRAWWATER|SURF_DRAWTELE))==(SURF_DRAWWATER|SURF_DRAWTELE))
continue; continue;
//this check is somewhat risky, but we should be able to get away with it. //this check is somewhat risky, but we should be able to get away with it.
for (contenttype = 0, i = 0; i < leaf->nummarksurfaces; i++) for (contenttype = 0, j = 0; j < leaf->nummarksurfaces; j++)
if (leaf->firstmarksurface[i]->flags & (SURF_DRAWWATER|SURF_DRAWTELE)) if (leaf->firstmarksurface[j]->flags & (SURF_DRAWWATER|SURF_DRAWTELE))
{ {
contenttype = leaf->firstmarksurface[i]->flags & (SURF_DRAWWATER|SURF_DRAWTELE); contenttype = leaf->firstmarksurface[j]->flags & (SURF_DRAWWATER|SURF_DRAWTELE);
break; break;
} }
//its possible that this leaf has absolutely no surfaces in it, turb or otherwise. //its possible that this leaf has absolutely no surfaces in it, turb or otherwise.