From 40e728fdb5d428532ecd5f9fa73a2ea0a4a83b73 Mon Sep 17 00:00:00 2001
From: Monster Iestyn <iestynjealous@ntlworld.com>
Date: Mon, 9 Mar 2020 15:04:22 +0000
Subject: [PATCH] One line fix: don't assume 0 (aka SPR2_STND) is the default
 value for sprite2, but rather what the state sets for it

This fixes some issues with a custom character tested during netplay, which did not have SPR2_WAIT sprites and therefore fell back to SPR2_STND sprites. Unfortunately, the fact they used SPR2_STND instead meant the sprite2 was not synced at all!
---
 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 e8c6c7a84d..fc8d9d4ee8 100644
--- a/src/p_saveg.c
+++ b/src/p_saveg.c
@@ -1406,7 +1406,7 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
 		diff |= MD_TICS;
 	if (mobj->sprite != mobj->state->sprite)
 		diff |= MD_SPRITE;
-	if (mobj->sprite == SPR_PLAY && mobj->sprite2 != 0)
+	if (mobj->sprite == SPR_PLAY && mobj->sprite2 != (mobj->state->frame&FF_FRAMEMASK))
 		diff |= MD_SPRITE;
 	if (mobj->frame != mobj->state->frame)
 		diff |= MD_FRAME;
-- 
GitLab