ZDBSP: Changed GetPolyExtents() limitter to count down instead of up.

SVN r1339 (trunk)
This commit is contained in:
Randy Heit 2009-01-01 04:29:30 +00:00
parent ba25ef01f6
commit 2bb9246cc3
1 changed files with 2 additions and 3 deletions

View File

@ -404,7 +404,7 @@ bool FNodeBuilder::GetPolyExtents (int polynum, fixed_t bbox[4])
{
vertex_t start;
unsigned int vert;
unsigned int count = 0;
unsigned int count = Segs.Size(); // to prevent endless loops. Stop when this reaches the number of segs.
vert = Segs[i].v1;
@ -416,8 +416,7 @@ bool FNodeBuilder::GetPolyExtents (int polynum, fixed_t bbox[4])
AddSegToBBox (bbox, &Segs[i]);
vert = Segs[i].v2;
i = Vertices[vert].segs;
count++; // to prevent endless loops. Stop when this reaches the number of segs.
} while (i != DWORD_MAX && (Vertices[vert].x != start.x || Vertices[vert].y != start.y) && count < Segs.Size());
} while (--count && i != DWORD_MAX && (Vertices[vert].x != start.x || Vertices[vert].y != start.y));
return true;
}