- Centralise the saving of player actions within DCorePlayer's serialiser.

This commit is contained in:
Mitchell Richters 2023-10-03 09:28:01 +11:00
parent 27ae6a4c20
commit 03d957ffdf
5 changed files with 7 additions and 13 deletions

View file

@ -635,9 +635,15 @@ void DCorePlayer::Serialize(FSerializer& arc)
arc("pnum", pnum)
("actor", actor)
("angles", Angles)
("actions", cmd.ucmd.actions)
//("cmd", cmd)
//("lastcmd", lastcmd)
;
if (arc.isReading())
{
cmd.ucmd.actions &= SB_CENTERVIEW|SB_CROUCH; // these are the only bits we need to preserve.
}
}
void DCoreActor::Serialize(FSerializer& arc)

View file

@ -2477,14 +2477,12 @@ void DBloodPlayer::Serialize(FSerializer& arc)
("quakeeffect", quakeEffect)
("player_par", player_par)
("waterpal", nWaterPal)
("actions", cmd.ucmd.actions)
.Array("posturedata", &pPosture[0][0], &gPostureDefaults[0][0], kModeMax * kPostureMax) // only save actual changes in this.
;
if (arc.isReading())
{
playerResetPosture(this);
cmd.ucmd.actions &= SB_CENTERVIEW|SB_CROUCH; // these are the only bits we need to preserve.
}
}

View file

@ -258,7 +258,6 @@ void DDukePlayer::Serialize(FSerializer& arc)
("moto_on_oil", moto_on_oil)
("moto_on_mud", moto_on_mud)
// new stuff
("actions", cmd.ucmd.actions)
.Array("frags", frags, MAXPLAYERS)
("uservars", uservars)
("fistsign", fistsign);
@ -266,10 +265,8 @@ void DDukePlayer::Serialize(FSerializer& arc)
if (arc.isReading())
{
invdisptime = 0;
GetActor()->backuploc();
opyoff = pyoff;
backupweapon();
cmd.ucmd.actions &= SB_CENTERVIEW|SB_CROUCH; // these are the only bits we need to preserve.
}
}

View file

@ -2138,13 +2138,7 @@ void DExhumedPlayer::Serialize(FSerializer& arc)
("save", sPlayerSave)
("totalvel", totalvel)
("grenade", pPlayerGrenade)
("bUnderwater", bUnderwater)
("actions", cmd.ucmd.actions);
if (arc.isReading())
{
cmd.ucmd.actions &= SB_CENTERVIEW|SB_CROUCH; // these are the only bits we need to preserve.
}
("bUnderwater", bUnderwater);
}
FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerSave& w, PlayerSave* def)

View file

@ -559,7 +559,6 @@ void DSWPlayer::Serialize(FSerializer& arc)
{
ovect = vect;
obob_z = bob_z;
cmd.ucmd.actions &= SB_CENTERVIEW|SB_CROUCH; // these are the only bits we need to preserve.
memset(cookieQuote, 0, sizeof(cookieQuote)); // no need to remember this.
StartColor = 0;