Skip to content

Commit

Permalink
Hexen: you can't save if you aren't playing
Browse files Browse the repository at this point in the history
Co-Authored-By: kitchen-ace <47063032+kitchen-ace@users.noreply.github.com>
  • Loading branch information
JNechaevsky and kitchen-ace committed Feb 18, 2024
1 parent c104adf commit f67c4e9
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/hexen/mn_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ static void SCScreenSize(int option);
static boolean SCNetCheck(int option);
static void SCNetCheck2(int option);
static void SCLoadGame(int option);
static void SCSaveCheck(int option);
static void SCSaveGame(int option);
static void SCMessages(int option);
static void SCEndGame(int option);
Expand Down Expand Up @@ -247,7 +248,7 @@ static Menu_t ClassMenu = {

static MenuItem_t FilesItems[] = {
{ITT_SETMENU, "LOAD GAME", SCNetCheck2, 2, MENU_LOAD},
{ITT_SETMENU, "SAVE GAME", NULL, 0, MENU_SAVE}
{ITT_EFUNC, "SAVE GAME", SCSaveCheck, 0, MENU_SAVE}
};

static Menu_t FilesMenu = {
Expand Down Expand Up @@ -3798,7 +3799,6 @@ static void DrawFilesMenu(void)
// clear out the quicksave/quickload stuff
quicksave = 0;
quickload = 0;
CT_ClearMessage(&players[consoleplayer]);
}

// [crispy] support additional pages of savegames
Expand Down Expand Up @@ -4181,6 +4181,20 @@ static const char *const class_str[NUMCLASSES] =
"PIG",
};

// [JN] Check if Save Game menu should be accessable.
static void SCSaveCheck(int option)
{
if (!usergame)
{
CT_SetMessage(&players[consoleplayer],
"YOU CAN'T SAVE IF YOU AREN'T PLAYING", true, NULL);
}
else
{
SetMenu(MENU_SAVE);
}
}

static void SCSaveGame(int option)
{
char *ptr;
Expand Down

0 comments on commit f67c4e9

Please sign in to comment.