From f1a96bd7ee1df2e3cf0c2ab7b6b6f9ce4841778b Mon Sep 17 00:00:00 2001 From: Riku Salminen <38985578+Riku-S@users.noreply.github.com> Date: Thu, 10 Jun 2021 21:18:45 +0300 Subject: [PATCH] Add support for ghosts with netvars in 2.2.6 and before --- src/g_demo.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/g_demo.c b/src/g_demo.c index 7793e0272..45d09fdbd 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -726,6 +726,7 @@ void G_GhostTicker(void) g->mo->y = g->oldmo.y; g->mo->z = g->oldmo.z; P_SetThingPosition(g->mo); + g->mo->frame = g->oldmo.frame | tr_trans30<fadein) { @@ -2023,7 +2024,7 @@ void G_AddGhost(char *defdemoname) char name[17],skin[17],color[MAXCOLORNAME+1],*n,*pdemoname,md5[16]; UINT8 cnamelen; demoghost *gh; - UINT8 flags; + UINT8 flags, subversion; UINT8 *buffer,*p; mapthing_t *mthing; UINT16 count, ghostversion; @@ -2071,7 +2072,7 @@ void G_AddGhost(char *defdemoname) return; } p += 12; // DEMOHEADER p++; // VERSION - p++; // SUBVERSION + subversion = READUINT8(p); // SUBVERSION ghostversion = READUINT16(p); switch(ghostversion) { @@ -2170,9 +2171,19 @@ void G_AddGhost(char *defdemoname) count = READUINT16(p); while (count--) { - SKIPSTRING(p); - SKIPSTRING(p); - p++; + // In 2.2.7 netvar saving was updated + if (subversion < 7) + { + p += 2; + SKIPSTRING(p); + p++; + } + else + { + SKIPSTRING(p); + SKIPSTRING(p); + p++; + } } if (*p == DEMOMARKER)