Don't use a seperate count, I literally forgot id is useful for this

This commit is contained in:
toaster 2022-11-18 20:08:52 +00:00
parent 4235798d8a
commit 3ef98fd80d

View file

@ -3430,7 +3430,7 @@ static void M_LevelListFromGametype(INT16 gt)
if (levellist.newgametype == GT_RACE) if (levellist.newgametype == GT_RACE)
{ {
cupheader_t *cup = kartcupheaders; cupheader_t *cup = kartcupheaders;
UINT8 highestid = 0, count = 0; UINT8 highestid = 0;
// Make sure there's valid cups before going to this menu. // Make sure there's valid cups before going to this menu.
if (cup == NULL) if (cup == NULL)
@ -3443,11 +3443,10 @@ static void M_LevelListFromGametype(INT16 gt)
highestid = cup->id; highestid = cup->id;
if (Playing() && mapheaderinfo[gamemap-1] && mapheaderinfo[gamemap-1]->cup == cup) if (Playing() && mapheaderinfo[gamemap-1] && mapheaderinfo[gamemap-1]->cup == cup)
{ {
cupgrid.x = count % CUPMENU_COLUMNS; cupgrid.x = cup->id % CUPMENU_COLUMNS;
cupgrid.y = (count / CUPMENU_COLUMNS) % CUPMENU_ROWS; cupgrid.y = (cup->id / CUPMENU_COLUMNS) % CUPMENU_ROWS;
cupgrid.pageno = count / (CUPMENU_COLUMNS * CUPMENU_ROWS); cupgrid.pageno = cup->id / (CUPMENU_COLUMNS * CUPMENU_ROWS);
} }
count++;
} }
cup = cup->next; cup = cup->next;
} }