Skip to content

Commit

Permalink
Don't crash if E1M10 is next map
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Sep 1, 2023
1 parent 9c8265a commit b16df63
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,8 @@ static void G_DoCompleted(void)
{
case 8:
// [BH] this episode is complete, so select the next episode in the menu
if ((gamemode == registered && gameepisode < 3) || (gamemode == retail && gameepisode < (sigil ? 5 : 4)))
if ((gamemode == registered && gameepisode < 3)
|| (gamemode == retail && gameepisode < (sigil ? 5 : 4)))
{
episode++;
EpiDef.laston++;
Expand Down Expand Up @@ -1388,9 +1389,9 @@ static void G_DoCompleted(void)
else
{
if (secretexit && secretnextmap > 0)
wminfo.next = secretnextmap - (gameepisode - 1) * 10 - 1;
wminfo.next = secretnextmap - 1;
else if (nextmap > 0)
wminfo.next = nextmap - (gameepisode - 1) * 10 - 1;
wminfo.next = nextmap - 1;
else if (secretexit)
wminfo.next = 8; // go to secret level
else if (gamemap == 9)
Expand Down

0 comments on commit b16df63

Please sign in to comment.