From 43044ec032bcbdd88413467a3d494e1be6c51f81 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 18 Jun 2023 23:21:04 +0100 Subject: [PATCH] PlayCredits for Cups Hilariously broken due to the evaulation gamestate, but the first piece of the puzzle: gets the player into the Credits gamestate after the conclusion of a Podium, if the GP context's cup has this boolean set. --- src/deh_soc.c | 8 ++++++-- src/doomstat.h | 3 +++ src/g_game.c | 12 +++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/deh_soc.c b/src/deh_soc.c index 7037c7f36..f6509eabd 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -3126,7 +3126,7 @@ void readmaincfg(MYFILE *f, boolean mainfile) } else if (fastcmp(word, "LOOPTITLE")) { - looptitle = (value || word2[0] == 'T' || word2[0] == 'Y'); + looptitle = (value != 0 || word2[0] == 'T' || word2[0] == 'Y'); titlechanged = true; } else if (fastcmp(word, "TITLEMAP")) @@ -3137,7 +3137,7 @@ void readmaincfg(MYFILE *f, boolean mainfile) } else if (fastcmp(word, "HIDETITLEPICS") || fastcmp(word, "TITLEPICSHIDE")) { - hidetitlepics = (boolean)(value || word2[0] == 'T' || word2[0] == 'Y'); + hidetitlepics = (boolean)(value != 0 || word2[0] == 'T' || word2[0] == 'Y'); titlechanged = true; } else if (fastcmp(word, "TITLEPICSMODE")) @@ -3578,6 +3578,10 @@ void readcupheader(MYFILE *f, cupheader_t *cup) else deh_warning("%s Cup: invalid emerald number %d", cup->name, i); } + else if (fastcmp(word, "PLAYCREDITS")) + { + cup->playcredits = (i != 0 || word2[0] == 'T' || word2[0] == 'Y'); + } else deh_warning("%s Cup: unknown word '%s'", cup->name, word); } diff --git a/src/doomstat.h b/src/doomstat.h index d25ca720c..70d583f66 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -402,6 +402,9 @@ struct cupheader_t UINT8 numlevels; ///< Number of levels defined in levellist UINT8 numbonus; ///< Number of bonus stages defined UINT8 emeraldnum; ///< ID of Emerald to use for special stage (1-7 for Chaos Emeralds, 8-14 for Super Emeralds, 0 for no emerald) + + boolean playcredits; ///< Play the credits? + cupwindata_t windata[4]; ///< Data for cup visitation cupheader_t *next; ///< Next cup in linked list }; diff --git a/src/g_game.c b/src/g_game.c index 1b3dfa770..252e09368 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1813,7 +1813,17 @@ boolean G_Responder(event_t *ev) if (K_CeremonyResponder(ev)) { - nextmap = NEXTMAP_TITLE; + if (grandprixinfo.gp == true + && grandprixinfo.cup != NULL + && grandprixinfo.cup->playcredits == true) + { + nextmap = NEXTMAP_CREDITS; + } + else + { + nextmap = NEXTMAP_TITLE; + } + G_EndGame(); return true; }