Include pmomz for mobjs in net savestates and load if it exists

This commit is contained in:
John FrostFox 2021-12-09 11:42:06 +03:00
parent 6504557393
commit c420de6f11

View file

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