mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 12:01:47 +00:00
Fix two more minor issues with reading and writing replays.
* DXD_PLAYSTATE and DXD_WEAPONPREF no longer conflict when both are read during the same tic. (VERY rare bug, but was possible) * Fixed G_WriteDemoTiccmd not considering the sign of forwardmove properly. (Of basically no consequence r/n, but could bite us down the line if not caught)
This commit is contained in:
parent
4b42f99ca7
commit
9e12195840
1 changed files with 7 additions and 6 deletions
13
src/g_demo.c
13
src/g_demo.c
|
|
@ -308,9 +308,9 @@ void G_ReadDemoExtraData(void)
|
|||
}
|
||||
if (extradata & DXD_PLAYSTATE)
|
||||
{
|
||||
extradata = READUINT8(demo_p);
|
||||
i = READUINT8(demo_p);
|
||||
|
||||
switch (extradata) {
|
||||
switch (i) {
|
||||
case DXD_PST_PLAYING:
|
||||
players[p].pflags |= PF_WANTSTOJOIN; // fuck you
|
||||
//CONS_Printf("player %s is despectating on tic %d\n", player_names[p], leveltime);
|
||||
|
|
@ -350,11 +350,11 @@ void G_ReadDemoExtraData(void)
|
|||
}
|
||||
if (extradata & DXD_WEAPONPREF)
|
||||
{
|
||||
extradata = READUINT8(demo_p);
|
||||
i = READUINT8(demo_p);
|
||||
players[p].pflags &= ~(PF_KICKSTARTACCEL);
|
||||
if (extradata & 1)
|
||||
if (i & 1)
|
||||
players[p].pflags |= PF_KICKSTARTACCEL;
|
||||
//CONS_Printf("weaponpref is %d for player %d\n", extradata, p);
|
||||
//CONS_Printf("weaponpref is %d for player %d\n", i, p);
|
||||
}
|
||||
|
||||
p = READUINT8(demo_p);
|
||||
|
|
@ -500,6 +500,7 @@ void G_ReadDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|
|||
|
||||
if (!demo_p || !demo.deferstart)
|
||||
return;
|
||||
|
||||
ziptic = READUINT8(demo_p);
|
||||
|
||||
if (ziptic & ZT_FWD)
|
||||
|
|
@ -537,7 +538,7 @@ void G_WriteDemoTiccmd(ticcmd_t *cmd, INT32 playernum)
|
|||
|
||||
if (cmd->forwardmove != oldcmd[playernum].forwardmove)
|
||||
{
|
||||
WRITEUINT8(demo_p,cmd->forwardmove);
|
||||
WRITESINT8(demo_p,cmd->forwardmove);
|
||||
oldcmd[playernum].forwardmove = cmd->forwardmove;
|
||||
ziptic |= ZT_FWD;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue