Don't resync position until off for two tics in a row

This patches over a few trouble spots, like Misty Maze, causing
consistent resyncs and screwing up playback.
This commit is contained in:
fickleheart 2019-03-19 22:59:27 -05:00
parent 7fc1f02b07
commit 438cabcd24
1 changed files with 19 additions and 8 deletions

View File

@ -323,6 +323,8 @@ static struct {
INT32 kartitem, kartamount, kartbumpers; INT32 kartitem, kartamount, kartbumpers;
boolean kartresync; //@TODO backwards compat with old replays. remove eventually boolean kartresync; //@TODO backwards compat with old replays. remove eventually
UINT8 desyncframes; // Don't try to resync unless we've been off for two frames, to monkeypatch a few trouble spots
// EZT_HIT // EZT_HIT
UINT16 hits; UINT16 hits;
mobj_t **hitlist; mobj_t **hitlist;
@ -5547,6 +5549,10 @@ void G_ConsGhostTic(INT32 playernum)
gz = oldghost[playernum].z; gz = oldghost[playernum].z;
if (nightsfail || abs(px-gx) > syncleeway || abs(py-gy) > syncleeway || abs(pz-gz) > syncleeway) if (nightsfail || abs(px-gx) > syncleeway || abs(py-gy) > syncleeway || abs(pz-gz) > syncleeway)
{
ghostext[playernum].desyncframes++;
if (ghostext[playernum].desyncframes >= 2)
{ {
if (demosynced) if (demosynced)
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n")); CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
@ -5557,7 +5563,12 @@ void G_ConsGhostTic(INT32 playernum)
testmo->y = oldghost[playernum].y; testmo->y = oldghost[playernum].y;
P_SetThingPosition(testmo); P_SetThingPosition(testmo);
testmo->z = oldghost[playernum].z; testmo->z = oldghost[playernum].z;
ghostext[playernum].desyncframes = 2;
} }
}
else
ghostext[playernum].desyncframes = 0;
if ( if (
ghostext[playernum].kartresync && ( ghostext[playernum].kartresync && (