mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-01 07:11:02 +00:00
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
This commit is contained in:
parent
e45b2ea257
commit
1f72df4edb
1 changed files with 72 additions and 59 deletions
17
src/g_game.c
17
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_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_ATTACKMASK 0x06 // This demo is from ??? attack and contains ???
|
||||||
#define DF_ATTACKSHIFT 1
|
#define DF_ATTACKSHIFT 1
|
||||||
|
#define DF_MULTIPLAYER 0x80 // This demo contains a dynamic number of players!
|
||||||
|
|
||||||
// For demos
|
// For demos
|
||||||
#define ZT_FWD 0x01
|
#define ZT_FWD 0x01
|
||||||
|
@ -5442,7 +5443,7 @@ void G_BeginRecording(void)
|
||||||
memset(name,0,sizeof(name));
|
memset(name,0,sizeof(name));
|
||||||
|
|
||||||
demo_p = demobuffer;
|
demo_p = demobuffer;
|
||||||
demoflags = DF_GHOST|(modeattacking<<DF_ATTACKSHIFT);
|
demoflags = DF_GHOST|(multiplayer ? DF_MULTIPLAYER : (modeattacking<<DF_ATTACKSHIFT));
|
||||||
|
|
||||||
// Setup header.
|
// Setup header.
|
||||||
M_Memcpy(demo_p, DEMOHEADER, 12); demo_p += 12;
|
M_Memcpy(demo_p, DEMOHEADER, 12); demo_p += 12;
|
||||||
|
@ -5479,6 +5480,12 @@ void G_BeginRecording(void)
|
||||||
|
|
||||||
WRITEUINT32(demo_p,P_GetInitSeed());
|
WRITEUINT32(demo_p,P_GetInitSeed());
|
||||||
|
|
||||||
|
if (demoflags & DF_MULTIPLAYER) {
|
||||||
|
// Net replays don't store player info here! Just skip to the netvars and return out.
|
||||||
|
CV_SaveNetVars(&demo_p);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
for (i = 0; i < 16 && cv_playername.string[i]; i++)
|
for (i = 0; i < 16 && cv_playername.string[i]; i++)
|
||||||
name[i] = cv_playername.string[i];
|
name[i] = cv_playername.string[i];
|
||||||
|
@ -5836,6 +5843,7 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
|
|
||||||
demoflags = READUINT8(demo_p);
|
demoflags = READUINT8(demo_p);
|
||||||
modeattacking = (demoflags & DF_ATTACKMASK)>>DF_ATTACKSHIFT;
|
modeattacking = (demoflags & DF_ATTACKMASK)>>DF_ATTACKSHIFT;
|
||||||
|
multiplayer = !!(demoflags & DF_MULTIPLAYER);
|
||||||
CON_ToggleOff();
|
CON_ToggleOff();
|
||||||
|
|
||||||
hu_demotime = UINT32_MAX;
|
hu_demotime = UINT32_MAX;
|
||||||
|
@ -5861,6 +5869,7 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
// Random seed
|
// Random seed
|
||||||
randseed = READUINT32(demo_p);
|
randseed = READUINT32(demo_p);
|
||||||
|
|
||||||
|
if (!multiplayer) {
|
||||||
// Player name
|
// Player name
|
||||||
M_Memcpy(player_names[0],demo_p,16);
|
M_Memcpy(player_names[0],demo_p,16);
|
||||||
demo_p += 16;
|
demo_p += 16;
|
||||||
|
@ -5888,6 +5897,7 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
accelstart = READUINT8(demo_p);
|
accelstart = READUINT8(demo_p);
|
||||||
acceleration = READUINT8(demo_p);
|
acceleration = READUINT8(demo_p);
|
||||||
jumpfactor = READFIXED(demo_p);
|
jumpfactor = READFIXED(demo_p);
|
||||||
|
}
|
||||||
|
|
||||||
// net var data
|
// net var data
|
||||||
CV_LoadNetVars(&demo_p);
|
CV_LoadNetVars(&demo_p);
|
||||||
|
@ -5932,10 +5942,12 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
#endif*/
|
#endif*/
|
||||||
displayplayer = consoleplayer = 0;
|
displayplayer = consoleplayer = 0;
|
||||||
memset(playeringame,0,sizeof(playeringame));
|
memset(playeringame,0,sizeof(playeringame));
|
||||||
playeringame[0] = true;
|
playeringame[0] = !multiplayer;
|
||||||
|
|
||||||
P_SetRandSeed(randseed);
|
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(false, G_BuildMapName(gamemap), true, true); // Doesn't matter whether you reset or not here, given changes to resetplayer.
|
||||||
|
|
||||||
|
if (!multiplayer) {
|
||||||
// Set skin
|
// Set skin
|
||||||
SetPlayerSkin(0, skin);
|
SetPlayerSkin(0, skin);
|
||||||
|
|
||||||
|
@ -5973,6 +5985,7 @@ void G_DoPlayDemo(char *defdemoname)
|
||||||
players[0].accelstart = accelstart;
|
players[0].accelstart = accelstart;
|
||||||
players[0].acceleration = acceleration;
|
players[0].acceleration = acceleration;
|
||||||
players[0].jumpfactor = jumpfactor;
|
players[0].jumpfactor = jumpfactor;
|
||||||
|
}
|
||||||
|
|
||||||
demo_start = true;
|
demo_start = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue