mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-13 00:24:17 +00:00
Print debugging message if sector->linecount is zero
This commit is contained in:
parent
742353d0ab
commit
df92dc8d9e
1 changed files with 18 additions and 7 deletions
|
@ -1931,10 +1931,18 @@ static void P_GroupLines(void)
|
|||
// allocate linebuffers for each sector
|
||||
for (i = 0, sector = sectors; i < numsectors; i++, sector++)
|
||||
{
|
||||
sector->lines = Z_Calloc(sector->linecount * sizeof(line_t*), PU_LEVEL, NULL);
|
||||
if (sector->linecount == 0) // no lines found?
|
||||
{
|
||||
sector->lines = NULL;
|
||||
CONS_Debug(DBG_SETUP, "P_GroupLines: sector %d has no lines\n", i);
|
||||
}
|
||||
else
|
||||
{
|
||||
sector->lines = Z_Calloc(sector->linecount * sizeof(line_t*), PU_LEVEL, NULL);
|
||||
|
||||
// zero the count, since we'll later use this to track how many we've recorded
|
||||
sector->linecount = 0;
|
||||
// zero the count, since we'll later use this to track how many we've recorded
|
||||
sector->linecount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// iterate through lines, assigning them to sectors' linebuffers,
|
||||
|
@ -1952,11 +1960,14 @@ static void P_GroupLines(void)
|
|||
{
|
||||
M_ClearBox(bbox);
|
||||
|
||||
for (j = 0; j < sector->linecount; j++)
|
||||
if (sector->linecount != 0)
|
||||
{
|
||||
li = sector->lines[j];
|
||||
M_AddToBox(bbox, li->v1->x, li->v1->y);
|
||||
M_AddToBox(bbox, li->v2->x, li->v2->y);
|
||||
for (j = 0; j < sector->linecount; j++)
|
||||
{
|
||||
li = sector->lines[j];
|
||||
M_AddToBox(bbox, li->v1->x, li->v1->y);
|
||||
M_AddToBox(bbox, li->v2->x, li->v2->y);
|
||||
}
|
||||
}
|
||||
|
||||
// set the degenmobj_t to the middle of the bounding box
|
||||
|
|
Loading…
Reference in a new issue