G_MapIntoRoundQueue: Fix infinite loop if Cup has more bonus stages than regular stages

This commit is contained in:
toaster 2023-05-08 17:46:25 +01:00
parent 9352b3ef07
commit 6aea8859fe

View file

@ -4066,7 +4066,7 @@ void G_MapIntoRoundQueue(UINT16 map, UINT8 setgametype, boolean setencore, boole
void G_GPCupIntoRoundQueue(cupheader_t *cup, UINT8 setgametype, boolean setencore)
{
UINT8 i, levelindex = 0, bonusindex = 0;
UINT8 bonusmodulo = (cup->numlevels+1)/(cup->numbonus+1);
UINT8 bonusmodulo = max(1, (cup->numlevels+1)/(cup->numbonus+1));
UINT16 cupLevelNum;
// Levels are added to the queue in the following pattern.