From 1f72df4edb632379ca60e8e210578b8481aeac9d Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 27 Jan 2019 14:33:38 -0600 Subject: [PATCH] Start with some strange multiplayer replay init stuff Mostly just disabling the parts of the replay that assume a single player, right now. # Conflicts: # src/g_game.c --- src/g_game.c | 131 ++++++++++++++++++++++++++++----------------------- 1 file changed, 72 insertions(+), 59 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index d8022e08..ba926c57 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4481,6 +4481,7 @@ 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_MULTIPLAYER 0x80 // This demo contains a dynamic number of players! // For demos #define ZT_FWD 0x01 @@ -5442,7 +5443,7 @@ void G_BeginRecording(void) memset(name,0,sizeof(name)); demo_p = demobuffer; - demoflags = DF_GHOST|(modeattacking<>DF_ATTACKSHIFT; + multiplayer = !!(demoflags & DF_MULTIPLAYER); CON_ToggleOff(); hu_demotime = UINT32_MAX; @@ -5861,33 +5869,35 @@ void G_DoPlayDemo(char *defdemoname) // Random seed randseed = READUINT32(demo_p); - // Player name - M_Memcpy(player_names[0],demo_p,16); - demo_p += 16; + if (!multiplayer) { + // Player name + M_Memcpy(player_names[0],demo_p,16); + demo_p += 16; - // Skin - M_Memcpy(skin,demo_p,16); - demo_p += 16; + // Skin + M_Memcpy(skin,demo_p,16); + demo_p += 16; - // Color - M_Memcpy(color,demo_p,16); - demo_p += 16; + // Color + M_Memcpy(color,demo_p,16); + demo_p += 16; - charability = READUINT8(demo_p); - charability2 = READUINT8(demo_p); - actionspd = (fixed_t)READUINT8(demo_p)<color = players[0].skincolor; + oldghost.x = players[0].mo->x; + oldghost.y = players[0].mo->y; + oldghost.z = players[0].mo->z; } - //CV_StealthSetValue(&cv_playercolor, players[0].skincolor); -- as far as I can tell this is more trouble than it's worth - if (players[0].mo) - { - players[0].mo->color = players[0].skincolor; - oldghost.x = players[0].mo->x; - oldghost.y = players[0].mo->y; - oldghost.z = players[0].mo->z; - } - // Set saved attribute values - // No cheat checking here, because even if they ARE wrong... - // it would only break the replay if we clipped them. - players[0].charability = charability; - players[0].charability2 = charability2; - players[0].actionspd = actionspd; - players[0].mindash = mindash; - players[0].maxdash = maxdash; - // SRB2kart - players[0].kartspeed = kartspeed; - players[0].kartweight = kartweight; - // - players[0].normalspeed = normalspeed; - players[0].runspeed = runspeed; - players[0].thrustfactor = thrustfactor; - players[0].accelstart = accelstart; - players[0].acceleration = acceleration; - players[0].jumpfactor = jumpfactor; + // Set saved attribute values + // No cheat checking here, because even if they ARE wrong... + // it would only break the replay if we clipped them. + players[0].charability = charability; + players[0].charability2 = charability2; + players[0].actionspd = actionspd; + players[0].mindash = mindash; + players[0].maxdash = maxdash; + // SRB2kart + players[0].kartspeed = kartspeed; + players[0].kartweight = kartweight; + // + players[0].normalspeed = normalspeed; + players[0].runspeed = runspeed; + players[0].thrustfactor = thrustfactor; + players[0].accelstart = accelstart; + players[0].acceleration = acceleration; + players[0].jumpfactor = jumpfactor; + } demo_start = true; }