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:
parent
7fc1f02b07
commit
438cabcd24
27
src/g_game.c
27
src/g_game.c
|
@ -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;
|
||||||
|
@ -5548,16 +5550,25 @@ void G_ConsGhostTic(INT32 playernum)
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
if (demosynced)
|
ghostext[playernum].desyncframes++;
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
|
|
||||||
demosynced = false;
|
|
||||||
|
|
||||||
P_UnsetThingPosition(testmo);
|
if (ghostext[playernum].desyncframes >= 2)
|
||||||
testmo->x = oldghost[playernum].x;
|
{
|
||||||
testmo->y = oldghost[playernum].y;
|
if (demosynced)
|
||||||
P_SetThingPosition(testmo);
|
CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n"));
|
||||||
testmo->z = oldghost[playernum].z;
|
demosynced = false;
|
||||||
|
|
||||||
|
P_UnsetThingPosition(testmo);
|
||||||
|
testmo->x = oldghost[playernum].x;
|
||||||
|
testmo->y = oldghost[playernum].y;
|
||||||
|
P_SetThingPosition(testmo);
|
||||||
|
testmo->z = oldghost[playernum].z;
|
||||||
|
|
||||||
|
ghostext[playernum].desyncframes = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
ghostext[playernum].desyncframes = 0;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
ghostext[playernum].kartresync && (
|
ghostext[playernum].kartresync && (
|
||||||
|
|
Loading…
Reference in New Issue