Fixes for serializing and initializing

Fixed missing DViewPosition serializing. Fixed missing initializers in player_t.
This commit is contained in:
Boondorl 2024-11-14 22:27:08 -05:00 committed by Rachael Alexanderson
parent 26cff374de
commit 4726cc9ec5
4 changed files with 17 additions and 13 deletions

View file

@ -756,12 +756,6 @@ public:
int Flags;
// Functions
DViewPosition()
{
Offset = { 0,0,0 };
Flags = 0;
}
void Set(DVector3 &off, int f = -1)
{
ZeroSubnormalsF(off.X);
@ -777,6 +771,8 @@ public:
{
return Offset.isZero();
}
void Serialize(FSerializer& arc) override;
};
const double MinVel = EQUAL_EPSILON;

View file

@ -322,8 +322,8 @@ public:
AActor *mo = nullptr;
uint8_t playerstate = 0;
ticcmd_t cmd = {};
usercmd_t original_cmd;
uint32_t original_oldbuttons;
usercmd_t original_cmd = {};
uint32_t original_oldbuttons = 0;
userinfo_t userinfo; // [RH] who is this?
@ -340,7 +340,7 @@ public:
// mo->velx and mo->vely represent true velocity experienced by player.
// This only represents the thrust that the player applies himself.
// This avoids anomalies with such things as Boom ice and conveyors.
DVector2 Vel = { 0,0 };
DVector2 Vel;
bool centering = false;
uint8_t turnticks = 0;
@ -419,10 +419,10 @@ public:
FString SoundClass;
FString LogText; // [RH] Log for Strife
FString SubtitleText;
int SubtitleCounter;
int SubtitleCounter = 0;
DAngle MinPitch = nullAngle; // Viewpitch limits (negative is up, positive is down)
DAngle MaxPitch = nullAngle;
DAngle MinPitch; // Viewpitch limits (negative is up, positive is down)
DAngle MaxPitch;
double crouchfactor = 0;
double crouchoffset = 0;
@ -432,7 +432,7 @@ public:
// [CW] I moved these here for multiplayer conversation support.
TObjPtr<AActor*> ConversationNPC = MakeObjPtr<AActor*>(nullptr), ConversationPC = MakeObjPtr<AActor*>(nullptr);
DAngle ConversationNPCAngle = nullAngle;
DAngle ConversationNPCAngle;
bool ConversationFaceTalker = false;
DVector3 LastSafePos = {}; // Mark the last known safe location the player was standing.

View file

@ -1545,6 +1545,13 @@ void DActorModelData::OnDestroy()
animationIDs.Reset();
}
void DViewPosition::Serialize(FSerializer& arc)
{
Super::Serialize(arc);
arc("offset", Offset)
("flags", Flags);
}
//----------------------------------------------------------------------------
//
// PROC P_ExplodeMissile

View file

@ -1788,6 +1788,7 @@ void player_t::Serialize(FSerializer &arc)
("musinfoactor", MUSINFOactor)
("musinfotics", MUSINFOtics)
("soundclass", SoundClass)
("angleoffsettargets", angleOffsetTargets);
("lastsafepos", LastSafePos);
if (arc.isWriting ())