Merge branch 'netsave-pmomz-fix' into 'next'

Include pmomz for mobjs in net savestates and load if it exists (Resolves #713)

Closes #713

See merge request STJr/SRB2!1675
This commit is contained in:
sphere 2021-12-20 12:32:55 +00:00
commit 3e8e6bcbb8

View file

@ -1603,7 +1603,7 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
diff2 = 0; diff2 = 0;
// not the default but the most probable // not the default but the most probable
if (mobj->momx != 0 || mobj->momy != 0 || mobj->momz != 0) if (mobj->momx != 0 || mobj->momy != 0 || mobj->momz != 0 || mobj->pmomz !=0)
diff |= MD_MOM; diff |= MD_MOM;
if (mobj->radius != mobj->info->radius) if (mobj->radius != mobj->info->radius)
diff |= MD_RADIUS; diff |= MD_RADIUS;
@ -1778,6 +1778,7 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
WRITEFIXED(save_p, mobj->momx); WRITEFIXED(save_p, mobj->momx);
WRITEFIXED(save_p, mobj->momy); WRITEFIXED(save_p, mobj->momy);
WRITEFIXED(save_p, mobj->momz); WRITEFIXED(save_p, mobj->momz);
WRITEFIXED(save_p, mobj->pmomz);
} }
if (diff & MD_RADIUS) if (diff & MD_RADIUS)
WRITEFIXED(save_p, mobj->radius); WRITEFIXED(save_p, mobj->radius);
@ -2776,6 +2777,7 @@ static thinker_t* LoadMobjThinker(actionf_p1 thinker)
mobj->momx = READFIXED(save_p); mobj->momx = READFIXED(save_p);
mobj->momy = READFIXED(save_p); mobj->momy = READFIXED(save_p);
mobj->momz = READFIXED(save_p); mobj->momz = READFIXED(save_p);
mobj->pmomz = READFIXED(save_p);
} // otherwise they're zero, and the memset took care of it } // otherwise they're zero, and the memset took care of it
if (diff & MD_RADIUS) if (diff & MD_RADIUS)