From d6c7bcdbdcb0def36b560881d1c78be324861c4d Mon Sep 17 00:00:00 2001 From: Chairn Date: Sun, 19 Nov 2023 17:33:34 +0100 Subject: [PATCH] Init vec2 members to 0 following #6256 --- src/game/client/components/camera.cpp | 4 ++++ src/game/client/components/controls.cpp | 4 ++++ src/game/client/components/menu_background.cpp | 4 ++++ src/game/client/components/particles.h | 1 + src/game/client/components/spectator.cpp | 1 + src/game/editor/editor.h | 1 + src/game/gamecore.cpp | 1 + src/game/server/entities/dragger.cpp | 1 + src/game/server/entities/gun.cpp | 1 + src/game/server/entities/laser.cpp | 1 + src/game/server/entities/light.cpp | 2 ++ src/game/server/entities/pickup.cpp | 1 + 12 files changed, 22 insertions(+) diff --git a/src/game/client/components/camera.cpp b/src/game/client/components/camera.cpp index 9dc393a90..4837be0ba 100644 --- a/src/game/client/components/camera.cpp +++ b/src/game/client/components/camera.cpp @@ -24,6 +24,10 @@ CCamera::CCamera() m_GotoTeleOffset = 0; m_GotoSwitchLastPos = ivec2(-1, -1); m_GotoTeleLastPos = ivec2(-1, -1); + + mem_zero(m_aLastPos, sizeof(m_aLastPos)); + m_PrevCenter = vec2(0, 0); + m_Center = vec2(0, 0); } float CCamera::ZoomProgress(float CurrentTime) const diff --git a/src/game/client/components/controls.cpp b/src/game/client/components/controls.cpp index c1c0ed9ed..fc4c590bc 100644 --- a/src/game/client/components/controls.cpp +++ b/src/game/client/components/controls.cpp @@ -20,6 +20,10 @@ CControls::CControls() mem_zero(&m_aLastData, sizeof(m_aLastData)); m_LastDummy = 0; m_OtherFire = 0; + + mem_zero(m_aMousePos, sizeof(m_aMousePos)); + mem_zero(m_aMousePosOnAction, sizeof(m_aMousePosOnAction)); + mem_zero(m_aTargetPos, sizeof(m_aTargetPos)); } void CControls::OnReset() diff --git a/src/game/client/components/menu_background.cpp b/src/game/client/components/menu_background.cpp index b9b0c97c0..7a6ee7b78 100644 --- a/src/game/client/components/menu_background.cpp +++ b/src/game/client/components/menu_background.cpp @@ -54,6 +54,10 @@ std::array GenerateMenuBackgroundPositions() CMenuBackground::CMenuBackground() : CBackground(CMapLayers::TYPE_FULL_DESIGN, false) { + m_RotationCenter = vec2(0.0f, 0.0f); + m_AnimationStartPos = vec2(0.0f, 0.0f); + m_Camera.m_Center = vec2(0.0f, 0.0f); + m_Camera.m_PrevCenter = vec2(0.0f, 0.0f); // unused in this class m_ChangedPosition = false; ResetPositions(); diff --git a/src/game/client/components/particles.h b/src/game/client/components/particles.h index 7b60aeea2..eb32993ce 100644 --- a/src/game/client/components/particles.h +++ b/src/game/client/components/particles.h @@ -10,6 +10,7 @@ struct CParticle { void SetDefault() { + m_Pos = vec2(0, 0); m_Vel = vec2(0, 0); m_LifeSpan = 0; m_StartSize = 32; diff --git a/src/game/client/components/spectator.cpp b/src/game/client/components/spectator.cpp index 0f5d28d40..f01f25433 100644 --- a/src/game/client/components/spectator.cpp +++ b/src/game/client/components/spectator.cpp @@ -162,6 +162,7 @@ void CSpectator::ConMultiView(IConsole::IResult *pResult, void *pUserData) CSpectator::CSpectator() { + m_SelectorMouse = vec2(0.0f, 0.0f); OnReset(); m_OldMouseX = m_OldMouseY = 0.0f; } diff --git a/src/game/editor/editor.h b/src/game/editor/editor.h index 19327666c..48123392c 100644 --- a/src/game/editor/editor.h +++ b/src/game/editor/editor.h @@ -390,6 +390,7 @@ public: m_QuadKnifeActive = false; m_QuadKnifeCount = 0; + mem_zero(m_aQuadKnifePoints, sizeof(m_aQuadKnifePoints)); m_CheckerTexture.Invalidate(); m_BackgroundTexture.Invalidate(); diff --git a/src/game/gamecore.cpp b/src/game/gamecore.cpp index 5dc1fd002..1c9c11dd3 100644 --- a/src/game/gamecore.cpp +++ b/src/game/gamecore.cpp @@ -99,6 +99,7 @@ void CCharacterCore::Reset() m_NewHook = false; m_HookPos = vec2(0, 0); m_HookDir = vec2(0, 0); + m_HookTeleBase = vec2(0, 0); m_HookTick = 0; m_HookState = HOOK_IDLE; SetHookedPlayer(-1); diff --git a/src/game/server/entities/dragger.cpp b/src/game/server/entities/dragger.cpp index a455c3029..e22800187 100644 --- a/src/game/server/entities/dragger.cpp +++ b/src/game/server/entities/dragger.cpp @@ -16,6 +16,7 @@ CDragger::CDragger(CGameWorld *pGameWorld, vec2 Pos, float Strength, bool IgnoreWalls, int Layer, int Number) : CEntity(pGameWorld, CGameWorld::ENTTYPE_LASER) { + m_Core = vec2(0.0f, 0.0f); m_Pos = Pos; m_Strength = Strength; m_IgnoreWalls = IgnoreWalls; diff --git a/src/game/server/entities/gun.cpp b/src/game/server/entities/gun.cpp index aa77858c3..5c03604d6 100644 --- a/src/game/server/entities/gun.cpp +++ b/src/game/server/entities/gun.cpp @@ -16,6 +16,7 @@ CGun::CGun(CGameWorld *pGameWorld, vec2 Pos, bool Freeze, bool Explosive, int Layer, int Number) : CEntity(pGameWorld, CGameWorld::ENTTYPE_LASER) { + m_Core = vec2(0.0f, 0.0f); m_Pos = Pos; m_Freeze = Freeze; m_Explosive = Explosive; diff --git a/src/game/server/entities/laser.cpp b/src/game/server/entities/laser.cpp index e0fd0e578..2907d5b95 100644 --- a/src/game/server/entities/laser.cpp +++ b/src/game/server/entities/laser.cpp @@ -20,6 +20,7 @@ CLaser::CLaser(CGameWorld *pGameWorld, vec2 Pos, vec2 Direction, float StartEner m_Dir = Direction; m_Bounces = 0; m_EvalTick = 0; + m_TelePos = vec2(0, 0); m_WasTele = false; m_Type = Type; m_TeleportCancelled = false; diff --git a/src/game/server/entities/light.cpp b/src/game/server/entities/light.cpp index 8a15cdfdb..42aea3f95 100644 --- a/src/game/server/entities/light.cpp +++ b/src/game/server/entities/light.cpp @@ -15,6 +15,8 @@ CLight::CLight(CGameWorld *pGameWorld, vec2 Pos, float Rotation, int Length, int Layer, int Number) : CEntity(pGameWorld, CGameWorld::ENTTYPE_LASER) { + m_To = vec2(0.0f, 0.0f); + m_Core = vec2(0.0f, 0.0f); m_Layer = Layer; m_Number = Number; m_Tick = (Server()->TickSpeed() * 0.15f); diff --git a/src/game/server/entities/pickup.cpp b/src/game/server/entities/pickup.cpp index 0e234f5fe..6b599a08e 100644 --- a/src/game/server/entities/pickup.cpp +++ b/src/game/server/entities/pickup.cpp @@ -15,6 +15,7 @@ static constexpr int gs_PickupPhysSize = 14; CPickup::CPickup(CGameWorld *pGameWorld, int Type, int SubType, int Layer, int Number) : CEntity(pGameWorld, CGameWorld::ENTTYPE_PICKUP, vec2(0, 0), gs_PickupPhysSize) { + m_Core = vec2(0.0f, 0.0f); m_Type = Type; m_Subtype = SubType;