Init vec2 members to 0 following #6256

This commit is contained in:
Chairn 2023-11-19 17:33:34 +01:00
parent 228810e01c
commit d6c7bcdbdc
12 changed files with 22 additions and 0 deletions

View file

@ -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

View file

@ -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()

View file

@ -54,6 +54,10 @@ std::array<vec2, CMenuBackground::NUM_POS> 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();

View file

@ -10,6 +10,7 @@ struct CParticle
{
void SetDefault()
{
m_Pos = vec2(0, 0);
m_Vel = vec2(0, 0);
m_LifeSpan = 0;
m_StartSize = 32;

View file

@ -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;
}

View file

@ -390,6 +390,7 @@ public:
m_QuadKnifeActive = false;
m_QuadKnifeCount = 0;
mem_zero(m_aQuadKnifePoints, sizeof(m_aQuadKnifePoints));
m_CheckerTexture.Invalidate();
m_BackgroundTexture.Invalidate();

View file

@ -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);

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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;