- fixed: The node builder's FindMapBounds function included all vertices generated by the node builder.

This could cause problems on maps with bogus nodes so it's better to only check vertices that are referenced by a linedef.
This commit is contained in:
Christoph Oelckers 2016-05-27 09:38:33 +02:00
parent 34c67b9eae
commit 19003a7973

View file

@ -616,12 +616,16 @@ void FNodeBuilder::FLevel::FindMapBounds()
minx = maxx = Vertices[0].fX(); minx = maxx = Vertices[0].fX();
miny = maxy = Vertices[0].fY(); miny = maxy = Vertices[0].fY();
for (int i = 1; i < NumVertices; ++i) for (int i = 1; i < NumLines; ++i)
{ {
if (Vertices[i].fX() < minx) minx = Vertices[i].fX(); for (int j = 0; j < 2; j++)
else if (Vertices[i].fX() > maxx) maxx = Vertices[i].fX(); {
if (Vertices[i].fY() < miny) miny = Vertices[i].fY(); vertex_t *v = (j == 0 ? Lines[i].v1 : Lines[i].v2);
else if (Vertices[i].fY() > maxy) maxy = Vertices[i].fY(); if (v->fX() < minx) minx = v->fX();
else if (v->fX() > maxx) maxx = v->fX();
if (v->fY() < miny) miny = v->fY();
else if (v->fY() > maxy) maxy = v->fY();
}
} }
MinX = FLOAT2FIXED(minx); MinX = FLOAT2FIXED(minx);