RingRacers/src/k_credits.h
Eidolon fc3128df12 Always exit TryRunTics loop early if deferring gamestate change
Calls to F_ContinueCredits and D_StartTitle, even if deferred,
change the current gamestate. However, the tic loop in TryRunTics
may still have a couple tics to execute to catch up to current
time, and as a consequence G_Ticker may execute game logic while
the current state is not GS_LEVEL or equivalent. As a result, it is
highly likely for the game to crash.

This adds deferred credits start to the tic loop, and exits that
loop if either title or credits are supposed to start after the
current iteration, fixing this crash scenario.

Fixes KartKrew/Kart#1185
2024-04-30 22:54:42 -05:00

49 lines
1 KiB
C

// DR. ROBOTNIK'S RING RACERS
//-----------------------------------------------------------------------------
// Copyright (C) 2024 by Sally "TehRealSalt" Cochenour
// Copyright (C) 2024 by Kart Krew
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file k_credits.h
/// \brief Grand Prix podium cutscene
#ifndef __K_CREDITS__
#define __K_CREDITS__
#include "doomtype.h"
#include "d_event.h"
#ifdef __cplusplus
extern "C" {
#endif
void F_LoadCreditsDefinitions(void);
void F_CreditsReset(void);
void F_StartCredits(void);
void F_DeferContinueCredits(void);
boolean F_IsDeferredContinueCredits(void);
void F_ContinueCredits(void);
void F_TickCreditsDemoExit(void);
INT32 F_CreditsDemoExitFade(void);
void F_ConsiderCreditsMusicUpdate(void);
void F_CreditTicker(void);
void F_CreditDrawer(void);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // __K_CREDITS__