'vector x, y, z for some reason always equals 0

Vector

public struct Vector3        
{
    public float x;
    public float y;
    public float z;      
}

public static void rcsmode()
{
    Vector3 vPunch;
    Vector3 CurrentViewAngles;
    Vector3 NewViewAngles;
    Vector3 OldAimPunch = new Vector3() { x = 0f, y = 0f, z = 0f };

    // For some reason the value of Vector3 is not being assigned

    if (isRcs)
    {
        int player = mem.Read<int>(client_dll + Offsets.dwLocalPlayer);
        int fire = mem.Read<int>(Offsets.m_iShotsFired);
        int pShotsFired = player + fire;

        if (pShotsFired > 1)
        {
            vPunch = mem.Read<Vector3>(player + Offsets.m_aimPunchAngle);
            int Clientstate = mem.Read<int>(client_dll + Offsets.dwClientState);
            CurrentViewAngles = mem.Read<Vector3>(Clientstate + Offsets.dwClientState_ViewAngles);

            NewViewAngles.x = (CurrentViewAngles.x + OldAimPunch.x) - (vPunch.x * 2);
            NewViewAngles.y = (CurrentViewAngles.y + OldAimPunch.y) - (vPunch.y * 2);                                                      
        }
        else
        {
            OldAimPunch.x = OldAimPunch.y = OldAimPunch.z = 0;
        }

I watched the debugger, the vector x, y, z for some reason always equals 0.
What is the problem?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source