From 15fcf60489675be66127742112787ad0d955e0cf Mon Sep 17 00:00:00 2001 From: Boondorl Date: Fri, 15 Nov 2024 23:48:18 -0500 Subject: [PATCH] Fixed angleOffsetTargets not being initialized --- src/playsim/d_player.h | 10 +++++----- src/playsim/p_user.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/playsim/d_player.h b/src/playsim/d_player.h index 47c339e426..862890f072 100644 --- a/src/playsim/d_player.h +++ b/src/playsim/d_player.h @@ -306,7 +306,7 @@ void WriteUserInfo(FSerializer &arc, userinfo_t &info); class player_t { public: - player_t() = default; + player_t() { angleOffsetTargets.Zero(); } ~player_t(); player_t &operator= (const player_t &p) = delete; void CopyFrom(player_t &src, bool copyPSP); @@ -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; + DVector2 Vel = { 0.0, 0.0 }; bool centering = false; uint8_t turnticks = 0; @@ -421,8 +421,8 @@ public: FString SubtitleText; int SubtitleCounter = 0; - DAngle MinPitch; // Viewpitch limits (negative is up, positive is down) - DAngle MaxPitch; + DAngle MinPitch = nullAngle; // Viewpitch limits (negative is up, positive is down) + DAngle MaxPitch = nullAngle; double crouchfactor = 0; double crouchoffset = 0; @@ -432,7 +432,7 @@ public: // [CW] I moved these here for multiplayer conversation support. TObjPtr ConversationNPC = MakeObjPtr(nullptr), ConversationPC = MakeObjPtr(nullptr); - DAngle ConversationNPCAngle; + DAngle ConversationNPCAngle = nullAngle; bool ConversationFaceTalker = false; DVector3 LastSafePos = {}; // Mark the last known safe location the player was standing. diff --git a/src/playsim/p_user.cpp b/src/playsim/p_user.cpp index ba41c77a60..19e987fb5a 100644 --- a/src/playsim/p_user.cpp +++ b/src/playsim/p_user.cpp @@ -1788,7 +1788,7 @@ void player_t::Serialize(FSerializer &arc) ("musinfoactor", MUSINFOactor) ("musinfotics", MUSINFOtics) ("soundclass", SoundClass) - ("angleoffsettargets", angleOffsetTargets); + ("angleoffsettargets", angleOffsetTargets) ("lastsafepos", LastSafePos); if (arc.isWriting ())