Skip to content

Commit

Permalink
Fix when to show skill level warning upon loading savegame
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Aug 2, 2024
1 parent 394e64e commit ce23386
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ static void G_DoSaveGame(void);

gameaction_t gameaction;
gamestate_t gamestate = GS_NONE;
skill_t gameskill;
skill_t prevgameskill;
skill_t gameskill = sk_none;
skill_t prevgameskill = sk_none;
int gameepisode;
int gamemap;
char speciallumpname[6] = "";
Expand Down Expand Up @@ -1670,7 +1670,7 @@ void G_LoadedGameMessage(void)
(hour < 12 ? "am" : "pm"), daynames[timestamp.tm_wday],
monthnames[timestamp.tm_mon], timestamp.tm_mday, 1900 + timestamp.tm_year);

if (gameskill != prevgameskill)
if (prevgameskill != sk_none && gameskill != prevgameskill)
{
char *temp2 = titlecase(*skilllevels[gameskill]);

Expand Down
4 changes: 3 additions & 1 deletion src/p_saveg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,9 @@ bool P_ReadSaveGameHeader(char *description)
return false; // bad version
}

prevgameskill = gameskill;
if (gameskill != sk_none)
prevgameskill = gameskill;

gameskill = (skill_t)saveg_read8();
gameepisode = saveg_read8();
gamemap = saveg_read8();
Expand Down

0 comments on commit ce23386

Please sign in to comment.