- Ensure all games preserve SB_CENTERVIEW and SB_CROUCH bits upon loading.

This commit is contained in:
Mitchell Richters 2023-09-24 17:22:38 +10:00
parent ff8cea673e
commit 32480dde16
3 changed files with 13 additions and 3 deletions

View file

@ -2491,8 +2491,14 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER*
("quakeeffect", w.quakeEffect)
("player_par", w.player_par)
("waterpal", w.nWaterPal)
("actions", w.input.actions)
.Array("posturedata", &w.pPosture[0][0], &gPostureDefaults[0][0], kModeMax * kPostureMax) // only save actual changes in this.
.EndObject();
if (arc.isReading())
{
w.input.actions &= SB_CENTERVIEW|SB_CROUCH; // these are the only bits we need to preserve.
}
}
return arc;
}

View file

@ -2152,8 +2152,13 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, Player& w, Player*
("totalvel", w.totalvel)
("grenade", w.pPlayerGrenade)
("bUnderwater", w.bUnderwater)
("actions", w.input.actions)
.EndObject();
if (arc.isReading())
{
w.input.actions &= SB_CENTERVIEW|SB_CROUCH; // these are the only bits we need to preserve.
}
}
return arc;
}

View file

@ -568,8 +568,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER*
{
w.ovect = w.vect;
w.obob_z = w.bob_z;
w.input = {};
w.lastinput = {};
w.input.actions &= SB_CENTERVIEW|SB_CROUCH; // these are the only bits we need to preserve.
memset(w.cookieQuote, 0, sizeof(w.cookieQuote)); // no need to remember this.
w.StartColor = 0;