mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-27 19:50:51 +00:00
Store cmd.latency in replays
This commit is contained in:
parent
83738a20b7
commit
894db0c6fd
1 changed files with 14 additions and 0 deletions
14
src/g_game.c
14
src/g_game.c
|
@ -4490,6 +4490,7 @@ char *G_BuildMapTitle(INT32 mapnum)
|
|||
#define ZT_BUTTONS 0x08
|
||||
#define ZT_AIMING 0x10
|
||||
#define ZT_DRIFT 0x20
|
||||
#define ZT_LATENCY 0x40
|
||||
#define DEMOMARKER 0x80 // demoend
|
||||
|
||||
static ticcmd_t oldcmd[MAXPLAYERS];
|
||||
|
@ -4573,6 +4574,8 @@ void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|
|||
oldcmd[playernum].aiming = READINT16(demo_p);
|
||||
if (ziptic & ZT_DRIFT)
|
||||
oldcmd[playernum].driftturn = READINT16(demo_p);
|
||||
if (ziptic & ZT_LATENCY)
|
||||
oldcmd[playernum].latency = READUINT8(demo_p);
|
||||
|
||||
G_CopyTiccmd(cmd, &oldcmd[playernum], 1);
|
||||
|
||||
|
@ -4643,6 +4646,13 @@ void G_WriteDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|
|||
ziptic |= ZT_DRIFT;
|
||||
}
|
||||
|
||||
if (cmd->latency != oldcmd[playernum].latency)
|
||||
{
|
||||
WRITEUINT8(demo_p,cmd->latency);
|
||||
oldcmd[playernum].latency = cmd->latency;
|
||||
ziptic |= ZT_LATENCY;
|
||||
}
|
||||
|
||||
*ziptic_p = ziptic;
|
||||
|
||||
// attention here for the ticcmd size!
|
||||
|
@ -5017,6 +5027,8 @@ void G_GhostTicker(void)
|
|||
g->p += 2;
|
||||
if (ziptic & ZT_DRIFT)
|
||||
g->p += 2;
|
||||
if (ziptic & ZT_LATENCY)
|
||||
g->p += 1;
|
||||
|
||||
// Grab ghost data.
|
||||
ziptic = READUINT8(g->p);
|
||||
|
@ -5404,6 +5416,8 @@ void G_RecordDemo(const char *name)
|
|||
{
|
||||
INT32 maxsize;
|
||||
|
||||
CONS_Printf("Recording demo %s\n", name);
|
||||
|
||||
strcpy(demoname, name);
|
||||
strcat(demoname, ".lmp");
|
||||
maxsize = 1024*1024;
|
||||
|
|
Loading…
Reference in a new issue