Merge branch 'fix-missing-evaluation' into 'master'

Fix missing evaluation screen at end of GP credits

Closes #1261

See merge request KartKrew/Kart!2247
This commit is contained in:
Sal 2024-04-09 18:41:53 +00:00
commit b8981b46bc
4 changed files with 31 additions and 10 deletions

View file

@ -1007,12 +1007,10 @@ typedef enum
#define EVALLEN_PERFECT (18*TICRATE)
static evaluationtype_t evaluationtype;
UINT16 finaleemeralds = 0;
static UINT16 finaleemeralds = 0;
void F_StartGameEvaluation(void)
void F_InitGameEvaluation(void)
{
S_StopMusicCredit();
// Credits option in extras menu
if (
grandprixinfo.gp == false
@ -1021,15 +1019,11 @@ void F_StartGameEvaluation(void)
#endif
)
{
F_StartGameEnd();
evaluationtype = EVAL_MAX; // skip
finaleemeralds = 0;
return;
}
G_SetGamestate(GS_EVALUATION);
// Just in case they're open ... somehow
M_ClearMenus(true);
UINT8 difficulty = KARTSPEED_NORMAL;
if (grandprixinfo.gp == true)
{
@ -1054,6 +1048,24 @@ void F_StartGameEvaluation(void)
evaluationtype = EVAL_SUPER;
else
evaluationtype = EVAL_PERFECT;
}
void F_StartGameEvaluation(void)
{
S_StopMusicCredit();
// Credits option in extras menu
// Set by F_InitGameEvaluation
if (evaluationtype == EVAL_MAX)
{
F_StartGameEnd();
return;
}
G_SetGamestate(GS_EVALUATION);
// Just in case they're open ... somehow
M_ClearMenus(true);
timetonext = (evaluationtype == EVAL_PERFECT) ? EVALLEN_PERFECT : EVALLEN_NORMAL;
@ -2276,7 +2288,10 @@ void F_EndCutScene(void)
else
{
if (cutnum == g_credits_cutscene-1)
{
F_InitGameEvaluation(); // FIXME: cutscenes are probably not used, I don't know if it works -jartha
F_StartGameEvaluation();
}
else if (cutnum == introtoplay-1)
D_StartTitle();
else

View file

@ -49,6 +49,7 @@ void F_WaitingPlayersTicker(void);
void F_WaitingPlayersDrawer(void);
void F_GameEvaluationDrawer(void);
void F_InitGameEvaluation(void); // depends on grandprixinfo!
void F_StartGameEvaluation(void);
void F_GameEvaluationTicker(void);

View file

@ -3193,6 +3193,7 @@ void G_FinishExitLevel(void)
}
else if (gamestate == GS_CREDITS)
{
F_InitGameEvaluation();
F_StartGameEvaluation();
}
}
@ -4860,6 +4861,7 @@ void G_EndGame(void)
}
if (nextmap == NEXTMAP_EVALUATION) // end game with evaluation
{
F_InitGameEvaluation();
F_StartGameEvaluation();
return;
}

View file

@ -391,6 +391,9 @@ void F_ConsiderCreditsMusicUpdate(void)
void F_StartCredits(void)
{
// Prepare evaluation screen at the end
F_InitGameEvaluation();
G_SetGamestate(GS_CREDITS);
// Just in case they're open ... somehow