diff --git a/src/d_main.cpp b/src/d_main.cpp index 4ccafff55..f6e56845b 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -150,6 +150,7 @@ boolean g_singletics = false; // timedemo boolean lastdraw = false; tic_t g_fast_forward = 0; +tic_t g_fast_forward_clock_stop = INFTICS; postimg_t postimgtype[MAXSPLITSCREENPLAYERS]; INT32 postimgparam[MAXSPLITSCREENPLAYERS]; diff --git a/src/doomstat.h b/src/doomstat.h index 255600a47..c09e7d96f 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -927,6 +927,7 @@ extern INT16 wipetypepost; // debug flag to cancel adaptiveness extern boolean g_singletics; extern tic_t g_fast_forward; +extern tic_t g_fast_forward_clock_stop; #define singletics (g_singletics == true || g_fast_forward > 0) diff --git a/src/g_game.c b/src/g_game.c index 29c131ae1..e92d790c9 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2030,7 +2030,19 @@ void G_Ticker(boolean run) if (g_fast_forward > 0) { + if (I_GetTime() > g_fast_forward_clock_stop) + { + // If too much real time has passed, end the fast-forward early. + g_fast_forward = 1; + } + g_fast_forward--; + + if (g_fast_forward == 0) + { + // Next fast-forward is unlimited. + g_fast_forward_clock_stop = INFTICS; + } } } }