From fc6e48dd3f61dd4f473c6d0e9b9495dd56edf90b Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 1 Aug 2010 19:50:41 +0000 Subject: [PATCH] - Fixed: FPolyObj::LinkPolyobj() did not add the polyobject's first side to the polyobject's bounding box. It should also add both vertices from each side, since non-closed polyobjects are possible with PolyObj_ExplicitLine. SVN r2485 (trunk) --- src/po_man.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/po_man.cpp b/src/po_man.cpp index 535d1f2dc..e0597190c 100644 --- a/src/po_man.cpp +++ b/src/po_man.cpp @@ -1314,20 +1314,18 @@ bool FPolyObj::CheckMobjBlocking (side_t *sd) void FPolyObj::LinkPolyobj () { - int leftX, rightX; - int topY, bottomY; polyblock_t **link; polyblock_t *tempLink; // calculate the polyobj bbox - vertex_t *vt = Sidedefs[0]->V1(); - rightX = leftX = vt->x; - topY = bottomY = vt->y; - Bounds.ClearBox(); - for(unsigned i = 1; i < Sidedefs.Size(); i++) + for(unsigned i = 0; i < Sidedefs.Size(); i++) { - vt = Sidedefs[i]->V1(); + vertex_t *vt; + + vt = Sidedefs[i]->linedef->v1; + Bounds.AddToBox(vt->x, vt->y); + vt = Sidedefs[i]->linedef->v2; Bounds.AddToBox(vt->x, vt->y); } bbox[BOXRIGHT] = (Bounds.Right() - bmaporgx) >> MAPBLOCKSHIFT;