From fe7c6c7f83166a0e6c0511831271736c4ba13920 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 3 Feb 2019 13:55:29 -0600 Subject: [PATCH] Add support for encore and battle replays --- src/g_game.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index 205773d7..171f0a44 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4629,6 +4629,9 @@ char *G_BuildMapTitle(INT32 mapnum) #define DF_NIGHTSATTACK 0x04 // This demo is from NiGHTS attack and contains its time left, score, and mares! #define DF_ATTACKMASK 0x06 // This demo is from ??? attack and contains ??? #define DF_ATTACKSHIFT 1 +#define DF_GAMETYPEMASK 0x30 +#define DF_GAMESHIFT 4 +#define DF_ENCORE 0x40 #define DF_MULTIPLAYER 0x80 // This demo contains a dynamic number of players! #define DEMO_SPECTATOR 0x40 @@ -5767,6 +5770,11 @@ void G_BeginRecording(void) demo_p = demobuffer; demoflags = multiplayer ? DF_MULTIPLAYER : (DF_GHOST|(modeattacking<>DF_ATTACKSHIFT; multiplayer = !!(demoflags & DF_MULTIPLAYER); + gametype = (demoflags & DF_GAMETYPEMASK)>>DF_GAMESHIFT; CON_ToggleOff(); hu_demotime = UINT32_MAX; @@ -6368,7 +6377,7 @@ void G_DoPlayDemo(char *defdemoname) } P_SetRandSeed(randseed); - G_InitNew(false, G_BuildMapName(gamemap), true, true); // Doesn't matter whether you reset or not here, given changes to resetplayer. + G_InitNew(demoflags & DF_ENCORE, G_BuildMapName(gamemap), true, true); // Doesn't matter whether you reset or not here, given changes to resetplayer. if (!multiplayer) { // Set skin