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

View file

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