public static bool GetTargetObject(GameObject[] Objects, out GameObject Object, out Vector3 Point, double Range)
    {
        double num  = Range + 1f;
        double num2 = 180f;

        Object = null;
        Point  = Vector3.zero;
        Vector3 position = OptimizationVariables.MainPlayer.look.aim.position;
        Vector3 forward  = OptimizationVariables.MainPlayer.look.aim.forward;

        foreach (GameObject gameObject in Objects)
        {
            if (!(gameObject == null))
            {
                Vector3 position2 = gameObject.transform.position;
                Player  component = gameObject.GetComponent <Player>();
                if (!component || (!component.life.isDead && !FriendUtilities.IsFriendly(component) && (!RaycastOptions.NoShootthroughthewalls || RaycastUtilities.NoShootthroughthewalls(gameObject.transform))))
                {
                    Zombie component2 = gameObject.GetComponent <Zombie>();
                    if (!component2 || !component2.isDead)
                    {
                        if (gameObject.GetComponent <RaycastComponent>() == null)
                        {
                            gameObject.AddComponent <RaycastComponent>();
                        }
                        else
                        {
                            double distance = VectorUtilities.GetDistance(position, position2);
                            if (distance <= Range)
                            {
                                if (RaycastOptions.SilentAimUseFOV)
                                {
                                    double angleDelta = VectorUtilities.GetAngleDelta(position, forward, position2);
                                    if (angleDelta > RaycastOptions.SilentAimFOV || angleDelta > num2)
                                    {
                                        goto IL_12A;
                                    }
                                    num2 = angleDelta;
                                }
                                else if (distance > num)
                                {
                                    goto IL_12A;
                                }
                                if (SphereUtilities.GetRaycast(gameObject, position, out Vector3 vector))
                                {
                                    Object = gameObject;
                                    num    = distance;
                                    Point  = vector;
                                }
                            }
                        }
                    }
                }
            }
            IL_12A :;
        }
        return(Object != null);
    }
    public static bool GenerateRaycast(out RaycastInfo info)
    {
        ItemGunAsset itemGunAsset = OptimizationVariables.MainPlayer.equipment.asset as ItemGunAsset;
        float        num          = (itemGunAsset != null) ? itemGunAsset.range : 15.5f;

        info = RaycastUtilities.GenerateOriginalRaycast(new Ray(OptimizationVariables.MainPlayer.look.aim.position, OptimizationVariables.MainPlayer.look.aim.forward), num, RayMasks.DAMAGE_CLIENT);
        if (RaycastOptions.EnablePlayerSelection && RaycastUtilities.TargetedPlayer != null)
        {
            GameObject gameObject = RaycastUtilities.TargetedPlayer.gameObject;
            bool       flag       = true;
            Vector3    position   = OptimizationVariables.MainPlayer.look.aim.position;
            if (Vector3.Distance(position, gameObject.transform.position) > num)
            {
                flag = false;
            }
            if (!SphereUtilities.GetRaycast(gameObject, position, out Vector3 point))
            {
                flag = false;
            }
            if (flag)
            {
                info = RaycastUtilities.GenerateRaycast(gameObject, point, info.collider);
                return(true);
            }
            if (RaycastOptions.OnlyShootAtSelectedPlayer)
            {
                return(false);
            }
        }

        if (RaycastUtilities.GetTargetObject(RaycastUtilities.Objects, out GameObject @object, out Vector3 point2, num))
        {
            info = RaycastUtilities.GenerateRaycast(@object, point2, info.collider);
            return(true);
        }
        return(false);
    }