- Make TranslateToStartSpot() set the new sector references for a polyobj's
walls so that P_CheckSwitchRange() will work with them. SVN r1951 (trunk)
This commit is contained in:
parent
0f96ec4a32
commit
321ab2f686
5 changed files with 29 additions and 10 deletions
|
|
@ -1565,21 +1565,30 @@ static void TranslateToStartSpot (int tag, int originX, int originY)
|
|||
(*tempSeg)->v1->x -= deltaX;
|
||||
(*tempSeg)->v1->y -= deltaY;
|
||||
}
|
||||
avg.x += (*tempSeg)->v1->x>>FRACBITS;
|
||||
avg.y += (*tempSeg)->v1->y>>FRACBITS;
|
||||
avg.x += (*tempSeg)->v1->x >> FRACBITS;
|
||||
avg.y += (*tempSeg)->v1->y >> FRACBITS;
|
||||
// the original Pts are based off the startSpot Pt, and are
|
||||
// unique to each seg, not each linedef
|
||||
tempPt->x = (*tempSeg)->v1->x-po->startSpot[0];
|
||||
tempPt->y = (*tempSeg)->v1->y-po->startSpot[1];
|
||||
}
|
||||
// Put polyobj in its subsector.
|
||||
avg.x /= po->numsegs;
|
||||
avg.y /= po->numsegs;
|
||||
sub = R_PointInSubsector (avg.x<<FRACBITS, avg.y<<FRACBITS);
|
||||
sub = R_PointInSubsector (avg.x << FRACBITS, avg.y << FRACBITS);
|
||||
if (sub->poly != NULL)
|
||||
{
|
||||
I_Error ("PO_TranslateToStartSpot: Multiple polyobjs in a single subsector.\n");
|
||||
}
|
||||
sub->poly = po;
|
||||
// Reassign the sides of the polyobj to its new sector.
|
||||
sector_t *sec = P_PointInSector (avg.x << FRACBITS, avg.y << FRACBITS);
|
||||
for (i = 0; i < po->numsegs; ++i)
|
||||
{
|
||||
po->segs[i]->linedef->frontsector = sec;
|
||||
po->segs[i]->linedef->sidedef[0]->sector = sec;
|
||||
po->segs[i]->frontsector = sec;
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue