Merge branch 'allowdesync' into 'next'

Add a console variable that will allow individual demos to desync....

See merge request STJr/SRB2!2361
This commit is contained in:
sphere 2024-06-03 13:45:37 +00:00
commit 6b8f4ab398
3 changed files with 12 additions and 5 deletions

View file

@ -67,6 +67,8 @@ static UINT8 *metalbuffer = NULL;
static UINT8 *metal_p; static UINT8 *metal_p;
static UINT16 metalversion; static UINT16 metalversion;
consvar_t cv_resyncdemo = CVAR_INIT("resyncdemo", "On", 0, CV_OnOff, NULL);
// extra data stuff (events registered this frame while recording) // extra data stuff (events registered this frame while recording)
static struct { static struct {
UINT8 flags; // EZT flags UINT8 flags; // EZT flags
@ -664,11 +666,14 @@ void G_ConsGhostTic(void)
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n")); CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
demosynced = false; demosynced = false;
P_UnsetThingPosition(testmo); if (cv_resyncdemo.value)
testmo->x = oldghost.x; {
testmo->y = oldghost.y; P_UnsetThingPosition(testmo);
P_SetThingPosition(testmo); testmo->x = oldghost.x;
testmo->z = oldghost.z; testmo->y = oldghost.y;
P_SetThingPosition(testmo);
testmo->z = oldghost.z;
}
} }
if (*demo_p == DEMOMARKER) if (*demo_p == DEMOMARKER)

View file

@ -35,6 +35,7 @@ typedef enum
} demo_file_override_e; } demo_file_override_e;
extern demo_file_override_e demofileoverride; extern demo_file_override_e demofileoverride;
extern consvar_t cv_resyncdemo;
// Quit after playing a demo from cmdline. // Quit after playing a demo from cmdline.
extern boolean singledemo; extern boolean singledemo;

View file

@ -691,6 +691,7 @@ void D_RegisterClientCommands(void)
COM_AddCommand("timedemo", Command_Timedemo_f, 0); COM_AddCommand("timedemo", Command_Timedemo_f, 0);
COM_AddCommand("stopdemo", Command_Stopdemo_f, COM_LUA); COM_AddCommand("stopdemo", Command_Stopdemo_f, COM_LUA);
COM_AddCommand("playintro", Command_Playintro_f, COM_LUA); COM_AddCommand("playintro", Command_Playintro_f, COM_LUA);
CV_RegisterVar(&cv_resyncdemo);
COM_AddCommand("resetcamera", Command_ResetCamera_f, COM_LUA); COM_AddCommand("resetcamera", Command_ResetCamera_f, COM_LUA);