From 2419b65f793a45cb3552cb527614906cc052b64d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 24 Apr 2020 16:40:09 +0100 Subject: [PATCH 1/2] Sync crumblestate in netgames --- src/p_saveg.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/p_saveg.c b/src/p_saveg.c index 259e58168..cfa93ef2f 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -755,6 +755,7 @@ static void P_NetUnArchiveColormaps(void) // diff3 flags #define SD_TAGLIST 0x01 #define SD_COLORMAP 0x02 +#define SD_CRUMBLESTATE 0x03 #define LD_FLAG 0x01 #define LD_SPECIAL 0x02 @@ -834,6 +835,8 @@ static void P_NetArchiveWorld(void) if (ss->extra_colormap != spawnss->extra_colormap) diff3 |= SD_COLORMAP; + if (ss->crumblestate) + diff3 |= SD_CRUMBLESTATE; // Check if any of the sector's FOFs differ from how they spawned if (ss->ffloors) @@ -901,6 +904,8 @@ static void P_NetArchiveWorld(void) if (diff3 & SD_COLORMAP) WRITEUINT32(put, CheckAddNetColormapToList(ss->extra_colormap)); // returns existing index if already added, or appends to net_colormaps and returns new index + if (diff3 & SD_CRUMBLESTATE) + WRITEINT32(put, ss->crumblestate); // Special case: save the stats of all modified ffloors along with their ffloor "number"s // we don't bother with ffloors that haven't changed, that would just add to savegame even more than is really needed @@ -1105,6 +1110,8 @@ static void P_NetUnArchiveWorld(void) if (diff3 & SD_COLORMAP) sectors[i].extra_colormap = GetNetColormapFromList(READUINT32(get)); + if (diff3 & SD_CRUMBLESTATE) + sectors[i].crumblestate = READINT32(get); if (diff & SD_FFLOORS) { From 9df5d6e1e016ef36049687c1bd5df34c5940bb89 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 24 Apr 2020 16:53:54 +0100 Subject: [PATCH 2/2] These are flags! Serves me right for just rushing this out --- src/p_saveg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index cfa93ef2f..7093ea93d 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -755,7 +755,7 @@ static void P_NetUnArchiveColormaps(void) // diff3 flags #define SD_TAGLIST 0x01 #define SD_COLORMAP 0x02 -#define SD_CRUMBLESTATE 0x03 +#define SD_CRUMBLESTATE 0x04 #define LD_FLAG 0x01 #define LD_SPECIAL 0x02