mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Fix demos doing incomprehensibly nasty bullshit; now they only desync for a handful of easier-to-hammer-down cases.
This commit is contained in:
parent
6f6e87f9df
commit
9c0edb097f
1 changed files with 17 additions and 7 deletions
20
src/g_demo.c
20
src/g_demo.c
|
|
@ -1205,9 +1205,6 @@ void G_GhostTicker(void)
|
||||||
g->p += 12; // kartitem, kartamount, kartbumpers
|
g->p += 12; // kartitem, kartamount, kartbumpers
|
||||||
}
|
}
|
||||||
|
|
||||||
if (READUINT8(g->p) != 0xFF) // Make sure there isn't other ghost data here.
|
|
||||||
I_Error("Ghost is not a record attack ghost"); //@TODO lmao don't blow up like this
|
|
||||||
|
|
||||||
skippedghosttic:
|
skippedghosttic:
|
||||||
// Tick ghost colors (Super and Mario Invincibility flashing)
|
// Tick ghost colors (Super and Mario Invincibility flashing)
|
||||||
switch(g->color)
|
switch(g->color)
|
||||||
|
|
@ -1294,6 +1291,7 @@ skippedghosttic:
|
||||||
P_RemoveMobj(follow);
|
P_RemoveMobj(follow);
|
||||||
P_SetTarget(&follow, NULL);
|
P_SetTarget(&follow, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Demo ends after ghost data.
|
// Demo ends after ghost data.
|
||||||
if (*g->p == DEMOMARKER)
|
if (*g->p == DEMOMARKER)
|
||||||
{
|
{
|
||||||
|
|
@ -1314,6 +1312,10 @@ skippedghosttic:
|
||||||
Z_Free(g);
|
Z_Free(g);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (READUINT8(g->p) != 0xFF) // Make sure there isn't other ghost data here.
|
||||||
|
I_Error("Ghost is not a record attack ghost"); //@TODO lmao don't blow up like this
|
||||||
|
|
||||||
p = g;
|
p = g;
|
||||||
#undef follow
|
#undef follow
|
||||||
}
|
}
|
||||||
|
|
@ -1899,6 +1901,7 @@ void G_BeginRecording(void)
|
||||||
if (encoremode)
|
if (encoremode)
|
||||||
demoflags |= DF_ENCORE;
|
demoflags |= DF_ENCORE;
|
||||||
|
|
||||||
|
if (multiplayer)
|
||||||
demoflags |= DF_LUAVARS;
|
demoflags |= DF_LUAVARS;
|
||||||
|
|
||||||
// Setup header.
|
// Setup header.
|
||||||
|
|
@ -2033,10 +2036,9 @@ void G_BeginRecording(void)
|
||||||
WRITEUINT8(demo_p, 0xFF); // Denote the end of the player listing
|
WRITEUINT8(demo_p, 0xFF); // Denote the end of the player listing
|
||||||
|
|
||||||
// player lua vars, always saved even if empty
|
// player lua vars, always saved even if empty
|
||||||
|
if (demoflags & DF_LUAVARS)
|
||||||
LUA_Archive(&demo_p);
|
LUA_Archive(&demo_p);
|
||||||
|
|
||||||
WRITEUINT32(demo_p,P_GetInitSeed());
|
|
||||||
|
|
||||||
memset(&oldcmd,0,sizeof(oldcmd));
|
memset(&oldcmd,0,sizeof(oldcmd));
|
||||||
memset(&oldghost,0,sizeof(oldghost));
|
memset(&oldghost,0,sizeof(oldghost));
|
||||||
memset(&ghostext,0,sizeof(ghostext));
|
memset(&ghostext,0,sizeof(ghostext));
|
||||||
|
|
@ -3145,6 +3147,14 @@ void G_AddGhost(char *defdemoname)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flags & DF_LUAVARS) // can't be arsed to add support for grinding away ported lua material
|
||||||
|
{
|
||||||
|
CONS_Alert(CONS_NOTICE, M_GetText("Ghost %s: Replay data contains luavars, cannot continue.\n"), pdemoname);
|
||||||
|
Z_Free(pdemoname);
|
||||||
|
Z_Free(buffer);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
p++; // gametype
|
p++; // gametype
|
||||||
G_SkipDemoExtraFiles(&p); // Don't wanna modify the file list for ghosts.
|
G_SkipDemoExtraFiles(&p); // Don't wanna modify the file list for ghosts.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue