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.
This commit is contained in:
toaster 2023-06-18 23:21:04 +01:00
parent 8d3e828663
commit 43044ec032
3 changed files with 20 additions and 3 deletions

View file

@ -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);
}

View file

@ -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
};

View file

@ -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;
}