コード例 #1
0
        public override bool Update(GameProcess gameProcess)
        {
            if (!base.Update(gameProcess))
            {
                return(false);
            }

            // Read data
            EyePosition   = getPlayerEyePosition(gameProcess);
            ViewAngles    = gameProcess.Process.Read <Vector3>(gameProcess.ModuleEngine.Read <IntPtr>(Offsets.dwClientState) + Offsets.dwClientState_ViewAngles);
            EyeDirection  = GfxMath.GetVectorFromEulerAngles(GfxMath.DegreeToRadian(ViewAngles.X), GfxMath.DegreeToRadian(ViewAngles.Y));
            AimPunchAngle = gameProcess.Process.Read <Vector3>(AddressBase + Offsets.m_aimPunchAngle);
            Fov           = gameProcess.Process.Read <int>(AddressBase + Offsets.m_iFOV);
            if (Fov == 0)
            {
                Fov = 90;           // correct for default
            }
            // Update player info
            vecVelocity  = getPlayerVecVelocity(gameProcess);
            ActiveWeapon = getActiveWeapon(gameProcess);
            UpdatePrimaryWeapon(ActiveWeapon);
            AmmoCount         = AmmoCounter(gameProcess);
            HasDefuseKit      = checkIfHasDefuseKit(gameProcess);
            isAimingDownScope = checkIfAds(gameProcess);
            CanShoot          = checkIfCanShoot(gameProcess);
            CursorLocked      = checkIfCursorLocked(gameProcess);
            Location          = getPlayerLocation(gameProcess);

            // calc data
            AimDirection = GetAimDirection(ViewAngles, AimPunchAngle);

            return(true);
        }