// Token: 0x060001AE RID: 430 RVA: 0x00002C14 File Offset: 0x00000E14
        public static IEnumerator PickupItems()
        {
            for (;;)
            {
                bool flag  = !DrawUtilities.ShouldRun() || !ItemOptions.AutoItemPickup;
                bool flag4 = flag;
                if (flag4)
                {
                    yield return(new WaitForSeconds(0.5f));
                }
                else
                {
                    Collider[] array = Physics.OverlapSphere(OptimizationVariables.MainPlayer.transform.position, 19f, RayMasks.ITEM);
                    int        num;
                    for (int i = 0; i < array.Length; i = num + 1)
                    {
                        Collider col   = array[i];
                        bool     flag2 = col == null || col.GetComponent <InteractableItem>() == null || col.GetComponent <InteractableItem>().asset == null;
                        bool     flag5 = !flag2;
                        if (flag5)
                        {
                            InteractableItem item  = col.GetComponent <InteractableItem>();
                            bool             flag3 = !ItemUtilities.Whitelisted(item.asset, ItemOptions.ItemFilterOptions);
                            bool             flag6 = !flag3;
                            if (flag6)
                            {
                                item.use();
                                col  = null;
                                item = null;
                            }
                            item = null;
                        }
                        num = i;
                        col = null;
                    }
                    yield return(new WaitForSeconds((float)(ItemOptions.ItemPickupDelay / 1000)));

                    array = null;
                    array = null;
                }
            }
            yield break;
        }
Example #2
0
        public static IEnumerator PickupItems()
        {
            // #if DEBUG
            DebugUtilities.Log("Starting Item Coroutine");
            //  #endif

            while (true)
            {
                if (!DrawUtilities.ShouldRun() || !ItemOptions.AutoItemPickup)
                {
                    yield return(new WaitForSeconds(0.5f));

                    continue;
                }

                Collider[] array = Physics.OverlapSphere(OptimizationVariables.MainPlayer.transform.position, 19f, RayMasks.ITEM);

                for (int i = 0; i < array.Length; i++)
                {
                    Collider col = array[i];
                    if (col == null || col.GetComponent <InteractableItem>() == null ||
                        col.GetComponent <InteractableItem>().asset == null)
                    {
                        continue;
                    }

                    InteractableItem item = col.GetComponent <InteractableItem>();

                    if (!ItemUtilities.Whitelisted(item.asset, ItemOptions.ItemFilterOptions))
                    {
                        continue;
                    }

                    item.use();
                }

                yield return(new WaitForSeconds(ItemOptions.ItemPickupDelay / 1000));
            }
        }
Example #3
0
        // Token: 0x06000187 RID: 391 RVA: 0x00002B7C File Offset: 0x00000D7C
        public static IEnumerator UpdateObjectList()
        {
            for (;;)
            {
                bool flag  = !DrawUtilities.ShouldRun();
                bool flag5 = flag;
                if (flag5)
                {
                    yield return(new WaitForSeconds(2f));
                }
                else
                {
                    List <ESPObject> objects = ESPVariables.Objects;
                    objects.Clear();
                    List <ESPTarget> targets = (from k in ESPOptions.PriorityTable.Keys
                                                orderby ESPOptions.PriorityTable[k] descending
                                                select k).ToList <ESPTarget>();
                    int num;
                    for (int i = 0; i < targets.Count; i = num + 1)
                    {
                        ESPTarget target = targets[i];
                        ESPVisual vis    = ESPOptions.VisualOptions[(int)target];
                        bool      flag2  = !vis.Enabled;
                        bool      flag6  = !flag2;
                        if (flag6)
                        {
                            Vector3 pPos = OptimizationVariables.MainPlayer.transform.position;
                            switch (target)
                            {
                            case ESPTarget.Игроки:
                            {
                                SteamPlayer[] objarray = (from p in Provider.clients
                                                          orderby VectorUtilities.GetDistance(pPos, p.player.transform.position) descending
                                                          select p).ToArray <SteamPlayer>();
                                bool useObjectCap = vis.UseObjectCap;
                                bool flag7        = useObjectCap;
                                if (flag7)
                                {
                                    objarray = objarray.TakeLast(vis.ObjectCap).ToArray <SteamPlayer>();
                                }
                                for (int j = 0; j < objarray.Length; j = num + 1)
                                {
                                    SteamPlayer sPlayer = objarray[j];
                                    Player      plr     = sPlayer.player;
                                    bool        flag3   = plr.life.isDead || plr == OptimizationVariables.MainPlayer;
                                    bool        flag8   = !flag3;
                                    if (flag8)
                                    {
                                        objects.Add(new ESPObject(target, plr, plr.gameObject));
                                        sPlayer = null;
                                        plr     = null;
                                    }
                                    num     = j;
                                    sPlayer = null;
                                    plr     = null;
                                }
                                break;
                            }

                            case ESPTarget.Зомби:
                            {
                                Zombie[] objarr = (from obj in ZombieManager.regions.SelectMany((ZombieRegion r) => r.zombies)
                                                   orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                   select obj).ToArray <Zombie>();
                                bool useObjectCap2 = vis.UseObjectCap;
                                bool flag9         = useObjectCap2;
                                if (flag9)
                                {
                                    objarr = objarr.TakeLast(vis.ObjectCap).ToArray <Zombie>();
                                }
                                for (int k2 = 0; k2 < objarr.Length; k2 = num + 1)
                                {
                                    Zombie obj9 = objarr[k2];
                                    objects.Add(new ESPObject(target, obj9, obj9.gameObject));
                                    obj9 = null;
                                    num  = k2;
                                    obj9 = null;
                                }
                                break;
                            }

                            case ESPTarget.Предметы:
                            {
                                InteractableItem[] objarr2 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableItem>()
                                                              orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                              select obj).ToArray <InteractableItem>();
                                bool useObjectCap3 = vis.UseObjectCap;
                                bool flag10        = useObjectCap3;
                                if (flag10)
                                {
                                    objarr2 = objarr2.TakeLast(vis.ObjectCap).ToArray <InteractableItem>();
                                }
                                for (int l = 0; l < objarr2.Length; l = num + 1)
                                {
                                    InteractableItem obj10  = objarr2[l];
                                    bool             flag4  = ItemUtilities.Whitelisted(obj10.asset, ItemOptions.ItemESPOptions) || !ESPOptions.FilterItems;
                                    bool             flag11 = flag4;
                                    if (flag11)
                                    {
                                        objects.Add(new ESPObject(target, obj10, obj10.gameObject));
                                    }
                                    obj10 = null;
                                    num   = l;
                                    obj10 = null;
                                }
                                break;
                            }

                            case ESPTarget.Турели:
                            {
                                InteractableSentry[] objarr3 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableSentry>()
                                                                orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                                select obj).ToArray <InteractableSentry>();
                                bool useObjectCap4 = vis.UseObjectCap;
                                bool flag12        = useObjectCap4;
                                if (flag12)
                                {
                                    objarr3 = objarr3.TakeLast(vis.ObjectCap).ToArray <InteractableSentry>();
                                }
                                for (int m = 0; m < objarr3.Length; m = num + 1)
                                {
                                    InteractableSentry obj11 = objarr3[m];
                                    objects.Add(new ESPObject(target, obj11, obj11.gameObject));
                                    obj11 = null;
                                    num   = m;
                                    obj11 = null;
                                }
                                break;
                            }

                            case ESPTarget.Кровати:
                            {
                                InteractableBed[] objarr4 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableBed>()
                                                             orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                             select obj).ToArray <InteractableBed>();
                                bool useObjectCap5 = vis.UseObjectCap;
                                bool flag13        = useObjectCap5;
                                if (flag13)
                                {
                                    objarr4 = objarr4.TakeLast(vis.ObjectCap).ToArray <InteractableBed>();
                                }
                                for (int n = 0; n < objarr4.Length; n = num + 1)
                                {
                                    InteractableBed obj12 = objarr4[n];
                                    objects.Add(new ESPObject(target, obj12, obj12.gameObject));
                                    obj12 = null;
                                    num   = n;
                                    obj12 = null;
                                }
                                break;
                            }

                            case ESPTarget.КлеймФлаги:
                            {
                                InteractableClaim[] objarr5 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableClaim>()
                                                               orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                               select obj).ToArray <InteractableClaim>();
                                bool useObjectCap6 = vis.UseObjectCap;
                                bool flag14        = useObjectCap6;
                                if (flag14)
                                {
                                    objarr5 = objarr5.TakeLast(vis.ObjectCap).ToArray <InteractableClaim>();
                                }
                                for (int j2 = 0; j2 < objarr5.Length; j2 = num + 1)
                                {
                                    InteractableClaim obj13 = objarr5[j2];
                                    objects.Add(new ESPObject(target, obj13, obj13.gameObject));
                                    obj13 = null;
                                    num   = j2;
                                    obj13 = null;
                                }
                                break;
                            }

                            case ESPTarget.Транспорт:
                            {
                                InteractableVehicle[] objarr6 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableVehicle>()
                                                                 orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                                 select obj).ToArray <InteractableVehicle>();
                                bool useObjectCap7 = vis.UseObjectCap;
                                bool flag15        = useObjectCap7;
                                if (flag15)
                                {
                                    objarr6 = objarr6.TakeLast(vis.ObjectCap).ToArray <InteractableVehicle>();
                                }
                                for (int j3 = 0; j3 < objarr6.Length; j3 = num + 1)
                                {
                                    InteractableVehicle obj14 = objarr6[j3];
                                    bool isDead = obj14.isDead;
                                    bool flag16 = !isDead;
                                    if (flag16)
                                    {
                                        objects.Add(new ESPObject(target, obj14, obj14.gameObject));
                                        obj14 = null;
                                    }
                                    num   = j3;
                                    obj14 = null;
                                }
                                break;
                            }

                            case ESPTarget.Ящики:
                            {
                                InteractableStorage[] objarr7 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableStorage>()
                                                                 orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                                 select obj).ToArray <InteractableStorage>();
                                bool useObjectCap8 = vis.UseObjectCap;
                                bool flag17        = useObjectCap8;
                                if (flag17)
                                {
                                    objarr7 = objarr7.TakeLast(vis.ObjectCap).ToArray <InteractableStorage>();
                                }
                                for (int j4 = 0; j4 < objarr7.Length; j4 = num + 1)
                                {
                                    InteractableStorage obj15 = objarr7[j4];
                                    objects.Add(new ESPObject(target, obj15, obj15.gameObject));
                                    obj15 = null;
                                    num   = j4;
                                    obj15 = null;
                                }
                                break;
                            }

                            case ESPTarget.Генераторы:
                            {
                                InteractableGenerator[] objarr8 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableGenerator>()
                                                                   orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                                   select obj).ToArray <InteractableGenerator>();
                                bool useObjectCap9 = vis.UseObjectCap;
                                bool flag18        = useObjectCap9;
                                if (flag18)
                                {
                                    objarr8 = objarr8.TakeLast(vis.ObjectCap).ToArray <InteractableGenerator>();
                                }
                                for (int j5 = 0; j5 < objarr8.Length; j5 = num + 1)
                                {
                                    InteractableGenerator obj16 = objarr8[j5];
                                    objects.Add(new ESPObject(target, obj16, obj16.gameObject));
                                    obj16 = null;
                                    num   = j5;
                                    obj16 = null;
                                }
                                break;
                            }

                            case ESPTarget.Животные:
                            {
                                Animal[] objarr9 = (from obj in UnityEngine.Object.FindObjectsOfType <Animal>()
                                                    orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                    select obj).ToArray <Animal>();
                                bool useObjectCap10 = vis.UseObjectCap;
                                bool flag19         = useObjectCap10;
                                if (flag19)
                                {
                                    objarr9 = objarr9.TakeLast(vis.ObjectCap).ToArray <Animal>();
                                }
                                for (int j6 = 0; j6 < objarr9.Length; j6 = num + 1)
                                {
                                    Animal obj17 = objarr9[j6];
                                    objects.Add(new ESPObject(target, obj17, obj17.gameObject));
                                    obj17 = null;
                                    num   = j6;
                                    obj17 = null;
                                }
                                break;
                            }

                            case ESPTarget.Ловшуки:
                            {
                                InteractableTrap[] objarr10 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableTrap>()
                                                               orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                               select obj).ToArray <InteractableTrap>();
                                bool useObjectCap11 = vis.UseObjectCap;
                                bool flag20         = useObjectCap11;
                                if (flag20)
                                {
                                    objarr10 = objarr10.TakeLast(vis.ObjectCap).ToArray <InteractableTrap>();
                                }
                                for (int j7 = 0; j7 < objarr10.Length; j7 = num + 1)
                                {
                                    InteractableTrap obj18 = objarr10[j7];
                                    objects.Add(new ESPObject(target, obj18, obj18.gameObject));
                                    obj18 = null;
                                    num   = j7;
                                    obj18 = null;
                                }
                                break;
                            }

                            case ESPTarget.Аирдропы:
                            {
                                Carepackage[] objarr11 = (from obj in UnityEngine.Object.FindObjectsOfType <Carepackage>()
                                                          orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                          select obj).ToArray <Carepackage>();
                                bool useObjectCap12 = vis.UseObjectCap;
                                bool flag21         = useObjectCap12;
                                if (flag21)
                                {
                                    objarr11 = objarr11.TakeLast(vis.ObjectCap).ToArray <Carepackage>();
                                }
                                for (int j8 = 0; j8 < objarr11.Length; j8 = num + 1)
                                {
                                    Carepackage obj19 = objarr11[j8];
                                    objects.Add(new ESPObject(target, obj19, obj19.gameObject));
                                    obj19 = null;
                                    num   = j8;
                                    obj19 = null;
                                }
                                break;
                            }

                            case ESPTarget.Двери:
                            {
                                InteractableDoorHinge[] objarr12 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableDoorHinge>()
                                                                    orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                                    select obj).ToArray <InteractableDoorHinge>();
                                bool useObjectCap13 = vis.UseObjectCap;
                                bool flag22         = useObjectCap13;
                                if (flag22)
                                {
                                    objarr12 = objarr12.TakeLast(vis.ObjectCap).ToArray <InteractableDoorHinge>();
                                }
                                for (int j9 = 0; j9 < objarr12.Length; j9 = num + 1)
                                {
                                    InteractableDoorHinge obj20 = objarr12[j9];
                                    objects.Add(new ESPObject(target, obj20, obj20.gameObject));
                                    obj20 = null;
                                    num   = j9;
                                    obj20 = null;
                                }
                                break;
                            }

                            case ESPTarget.Ягоды:
                            {
                                InteractableForage[] objarr13 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableForage>()
                                                                 orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                                 select obj).ToArray <InteractableForage>();
                                bool useObjectCap14 = vis.UseObjectCap;
                                bool flag23         = useObjectCap14;
                                if (flag23)
                                {
                                    objarr13 = objarr13.TakeLast(vis.ObjectCap).ToArray <InteractableForage>();
                                }
                                for (int j10 = 0; j10 < objarr13.Length; j10 = num + 1)
                                {
                                    InteractableForage obj21 = objarr13[j10];
                                    objects.Add(new ESPObject(target, obj21, obj21.gameObject));
                                    obj21 = null;
                                    num   = j10;
                                    obj21 = null;
                                }
                                break;
                            }

                            case ESPTarget.астения:
                            {
                                InteractableFarm[] objarr14 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableFarm>()
                                                               orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                               select obj).ToArray <InteractableFarm>();
                                bool useObjectCap15 = vis.UseObjectCap;
                                bool flag24         = useObjectCap15;
                                if (flag24)
                                {
                                    objarr14 = objarr14.TakeLast(vis.ObjectCap).ToArray <InteractableFarm>();
                                }
                                for (int j11 = 0; j11 < objarr14.Length; j11 = num + 1)
                                {
                                    InteractableFarm obj22 = objarr14[j11];
                                    objects.Add(new ESPObject(target, obj22, obj22.gameObject));
                                    obj22 = null;
                                    num   = j11;
                                    obj22 = null;
                                }
                                break;
                            }

                            case ESPTarget.C4:
                            {
                                InteractableCharge[] objarr15 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableCharge>()
                                                                 orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                                 select obj).ToArray <InteractableCharge>();
                                bool useObjectCap16 = vis.UseObjectCap;
                                bool flag25         = useObjectCap16;
                                if (flag25)
                                {
                                    objarr15 = objarr15.TakeLast(vis.ObjectCap).ToArray <InteractableCharge>();
                                }
                                for (int j12 = 0; j12 < objarr15.Length; j12 = num + 1)
                                {
                                    InteractableCharge obj23 = objarr15[j12];
                                    objects.Add(new ESPObject(target, obj23, obj23.gameObject));
                                    obj23 = null;
                                    num   = j12;
                                    obj23 = null;
                                }
                                break;
                            }

                            case ESPTarget.Fire:
                            {
                                InteractableFire[] objarr16 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableFire>()
                                                               orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                               select obj).ToArray <InteractableFire>();
                                bool useObjectCap17 = vis.UseObjectCap;
                                bool flag26         = useObjectCap17;
                                if (flag26)
                                {
                                    objarr16 = objarr16.TakeLast(vis.ObjectCap).ToArray <InteractableFire>();
                                }
                                for (int j13 = 0; j13 < objarr16.Length; j13 = num + 1)
                                {
                                    InteractableFire obj24 = objarr16[j13];
                                    objects.Add(new ESPObject(target, obj24, obj24.gameObject));
                                    obj24 = null;
                                    num   = j13;
                                    obj24 = null;
                                }
                                break;
                            }

                            case ESPTarget.Лампы:
                            {
                                InteractableSpot[] objarr17 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableSpot>()
                                                               orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                               select obj).ToArray <InteractableSpot>();
                                bool useObjectCap18 = vis.UseObjectCap;
                                bool flag27         = useObjectCap18;
                                if (flag27)
                                {
                                    objarr17 = objarr17.TakeLast(vis.ObjectCap).ToArray <InteractableSpot>();
                                }
                                for (int j14 = 0; j14 < objarr17.Length; j14 = num + 1)
                                {
                                    InteractableSpot obj25 = objarr17[j14];
                                    objects.Add(new ESPObject(target, obj25, obj25.gameObject));
                                    obj25 = null;
                                    num   = j14;
                                    obj25 = null;
                                }
                                break;
                            }

                            case ESPTarget.Топливо:
                            {
                                InteractableObjectResource[] objarr18 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableObjectResource>()
                                                                         orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                                         select obj).ToArray <InteractableObjectResource>();
                                bool useObjectCap19 = vis.UseObjectCap;
                                bool flag28         = useObjectCap19;
                                if (flag28)
                                {
                                    objarr18 = objarr18.TakeLast(vis.ObjectCap).ToArray <InteractableObjectResource>();
                                }
                                for (int j15 = 0; j15 < objarr18.Length; j15 = num + 1)
                                {
                                    InteractableObjectResource obj26 = objarr18[j15];
                                    objects.Add(new ESPObject(target, obj26, obj26.gameObject));
                                    obj26 = null;
                                    num   = j15;
                                    obj26 = null;
                                }
                                break;
                            }

                            case ESPTarget.Генератор_безопасной_зоны:
                            {
                                InteractableSafezone[] objarr19 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableSafezone>()
                                                                   orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                                   select obj).ToArray <InteractableSafezone>();
                                bool useObjectCap20 = vis.UseObjectCap;
                                bool flag29         = useObjectCap20;
                                if (flag29)
                                {
                                    objarr19 = objarr19.TakeLast(vis.ObjectCap).ToArray <InteractableSafezone>();
                                }
                                for (int j16 = 0; j16 < objarr19.Length; j16 = num + 1)
                                {
                                    InteractableSafezone obj27 = objarr19[j16];
                                    objects.Add(new ESPObject(target, obj27, obj27.gameObject));
                                    obj27 = null;
                                    num   = j16;
                                    obj27 = null;
                                }
                                break;
                            }

                            case ESPTarget.Генератор_Воздуха:
                            {
                                InteractableOxygenator[] objarr20 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableOxygenator>()
                                                                     orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                                     select obj).ToArray <InteractableOxygenator>();
                                bool useObjectCap21 = vis.UseObjectCap;
                                bool flag30         = useObjectCap21;
                                if (flag30)
                                {
                                    objarr20 = objarr20.TakeLast(vis.ObjectCap).ToArray <InteractableOxygenator>();
                                }
                                for (int j17 = 0; j17 < objarr20.Length; j17 = num + 1)
                                {
                                    InteractableOxygenator obj28 = objarr20[j17];
                                    objects.Add(new ESPObject(target, obj28, obj28.gameObject));
                                    obj28 = null;
                                    num   = j17;
                                    obj28 = null;
                                }
                                break;
                            }
                            }
                        }
                        num = i;
                        vis = null;
                    }
                    yield return(new WaitForSeconds(5f));

                    objects = null;
                    targets = null;
                    objects = null;
                    targets = null;
                }
            }
            yield break;
        }
Example #4
0
        public static IEnumerator UpdateObjectList()
        {
            while (true)
            {
                if (!DrawUtilities.ShouldRun())
                {
                    yield return(new WaitForSeconds(2));

                    continue;
                }
                List <ESPObject> objects = ESPVariables.Objects;
                objects.Clear();

                List <ESPTarget> targets =
                    ESPOptions.PriorityTable.Keys.OrderByDescending(k => ESPOptions.PriorityTable[k]).ToList();

                for (int i = 0; i < targets.Count; i++)
                {
                    ESPTarget target = targets[i];
                    ESPVisual vis    = ESPOptions.VisualOptions[(int)target];

                    if (!vis.Enabled)
                    {
                        continue;
                    }

                    Vector3 pPos = OptimizationVariables.MainPlayer.transform.position;

                    switch (target)
                    {
                    case ESPTarget.Players:
                    {
                        SteamPlayer[] objarray = Provider.clients
                                                 .OrderByDescending(p => VectorUtilities.GetDistance(pPos, p.player.transform.position)).ToArray();

                        if (vis.UseObjectCap)
                        {
                            objarray = objarray.TakeLast(vis.ObjectCap).ToArray();
                        }

                        for (int j = 0; j < objarray.Length; j++)
                        {
                            SteamPlayer sPlayer = objarray[j];
                            Player      plr     = sPlayer.player;

                            if (plr.life.isDead || plr == OptimizationVariables.MainPlayer)
                            {
                                continue;
                            }

                            objects.Add(new ESPObject(target, plr, plr.gameObject));
                        }
                        break;
                    }

                    case ESPTarget.Zombies:
                    {
                        Zombie[] objarr = ZombieManager.regions.SelectMany(r => r.zombies)
                                          .OrderByDescending(obj => VectorUtilities.GetDistance(pPos, obj.transform.position)).ToArray();

                        if (vis.UseObjectCap)
                        {
                            objarr = objarr.TakeLast(vis.ObjectCap).ToArray();
                        }

                        for (int j = 0; j < objarr.Length; j++)
                        {
                            Zombie obj = objarr[j];
                            objects.Add(new ESPObject(target, obj, obj.gameObject));
                        }

                        break;
                    }

                    case ESPTarget.Items:
                    {
                        InteractableItem[] objarr = Object.FindObjectsOfType <InteractableItem>()
                                                    .OrderByDescending(obj => VectorUtilities.GetDistance(pPos, obj.transform.position)).ToArray();

                        if (vis.UseObjectCap)
                        {
                            objarr = objarr.TakeLast(vis.ObjectCap).ToArray();
                        }

                        for (int j = 0; j < objarr.Length; j++)
                        {
                            InteractableItem obj = objarr[j];

                            if (ItemUtilities.Whitelisted(obj.asset, ItemOptions.ItemESPOptions) || !ESPOptions.FilterItems)
                            {
                                objects.Add(new ESPObject(target, obj, obj.gameObject));
                            }
                        }
                        break;
                    }

                    case ESPTarget.Sentries:
                    {
                        InteractableSentry[] objarr = Object.FindObjectsOfType <InteractableSentry>()
                                                      .OrderByDescending(obj => VectorUtilities.GetDistance(pPos, obj.transform.position)).ToArray();

                        if (vis.UseObjectCap)
                        {
                            objarr = objarr.TakeLast(vis.ObjectCap).ToArray();
                        }

                        for (int j = 0; j < objarr.Length; j++)
                        {
                            InteractableSentry obj = objarr[j];
                            objects.Add(new ESPObject(target, obj, obj.gameObject));
                        }
                        break;
                    }

                    case ESPTarget.Beds:
                    {
                        InteractableBed[] objarr = Object.FindObjectsOfType <InteractableBed>()
                                                   .OrderByDescending(obj => VectorUtilities.GetDistance(pPos, obj.transform.position)).ToArray();

                        if (vis.UseObjectCap)
                        {
                            objarr = objarr.TakeLast(vis.ObjectCap).ToArray();
                        }

                        for (int j = 0; j < objarr.Length; j++)
                        {
                            InteractableBed obj = objarr[j];
                            objects.Add(new ESPObject(target, obj, obj.gameObject));
                        }
                        break;
                    }

                    case ESPTarget.ClaimFlags:
                    {
                        InteractableClaim[] objarr = Object.FindObjectsOfType <InteractableClaim>()
                                                     .OrderByDescending(obj => VectorUtilities.GetDistance(pPos, obj.transform.position)).ToArray();

                        if (vis.UseObjectCap)
                        {
                            objarr = objarr.TakeLast(vis.ObjectCap).ToArray();
                        }

                        for (int j = 0; j < objarr.Length; j++)
                        {
                            InteractableClaim obj = objarr[j];
                            objects.Add(new ESPObject(target, obj, obj.gameObject));
                        }
                        break;
                    }

                    case ESPTarget.Vehicles:
                    {
                        InteractableVehicle[] objarr = Object.FindObjectsOfType <InteractableVehicle>()
                                                       .OrderByDescending(obj => VectorUtilities.GetDistance(pPos, obj.transform.position)).ToArray();

                        if (vis.UseObjectCap)
                        {
                            objarr = objarr.TakeLast(vis.ObjectCap).ToArray();
                        }

                        for (int j = 0; j < objarr.Length; j++)
                        {
                            InteractableVehicle obj = objarr[j];

                            if (obj.isDead)
                            {
                                continue;
                            }

                            objects.Add(new ESPObject(target, obj, obj.gameObject));
                        }
                        break;
                    }

                    case ESPTarget.Storage:
                    {
                        InteractableStorage[] objarr = Object.FindObjectsOfType <InteractableStorage>()
                                                       .OrderByDescending(obj => VectorUtilities.GetDistance(pPos, obj.transform.position)).ToArray();

                        if (vis.UseObjectCap)
                        {
                            objarr = objarr.TakeLast(vis.ObjectCap).ToArray();
                        }

                        for (int j = 0; j < objarr.Length; j++)
                        {
                            InteractableStorage obj = objarr[j];
                            objects.Add(new ESPObject(target, obj, obj.gameObject));
                        }
                        break;
                    }

                    case ESPTarget.Generators:
                    {
                        InteractableGenerator[] objarr = Object.FindObjectsOfType <InteractableGenerator>()
                                                         .OrderByDescending(obj => VectorUtilities.GetDistance(pPos, obj.transform.position)).ToArray();

                        if (vis.UseObjectCap)
                        {
                            objarr = objarr.TakeLast(vis.ObjectCap).ToArray();
                        }

                        for (int j = 0; j < objarr.Length; j++)
                        {
                            InteractableGenerator obj = objarr[j];
                            objects.Add(new ESPObject(target, obj, obj.gameObject));
                        }
                        break;
                    }
                    }
                }
                yield return(new WaitForSeconds(5));
            }
        }
Example #5
0
        public void OnGUI()
        {
            if (Event.current.type != EventType.Repaint || !ESPOptions.Enabled)
                return;

            if (!DrawUtilities.ShouldRun())
                return;

            GUI.depth = 1;

            if (MainCamera == null)
                MainCamera = OptimizationVariables.MainCam;

            Vector3 localPos = OptimizationVariables.MainPlayer.transform.position;

            Vector3 aimPos = OptimizationVariables.MainPlayer.look.aim.position;
            Vector3 aimForward = OptimizationVariables.MainPlayer.look.aim.forward;

            for (int i = 0; i < ESPVariables.Objects.Count; i++)
            {
                ESPObject obj = ESPVariables.Objects[i];
                ESPVisual visual = ESPOptions.VisualOptions[(int)obj.Target];

                GameObject go = obj.GObject;

                if (!visual.Enabled)
                {
                    Highlighter highlighter = go.GetComponent<Highlighter>();
                    if (highlighter != null && highlighter != TrajectoryComponent.Highlighted)
                        highlighter.ConstantOffImmediate();

                    continue;
                }
                if (obj.Target == ESPTarget.Items && ESPOptions.FilterItems)
                    if (!ItemUtilities.Whitelisted(((InteractableItem)obj.Object).asset, ItemOptions.ItemESPOptions))
                        continue;

                Color c = ColorUtilities.getColor($"_{obj.Target}");
                LabelLocation ll = visual.Location;

                if (go == null)
                    continue;

                Vector3 position = go.transform.position;
                double dist = VectorUtilities.GetDistance(position, localPos);

                if (dist < 0.5 || (dist > visual.Distance && !visual.InfiniteDistance))
                    continue;

                Vector3 cpos = MainCamera.WorldToScreenPoint(position);

                if (cpos.z <= 0)
                    continue;

                string text = "";

                Vector3 scale = go.transform.localScale;
                Bounds b;
                switch (obj.Target)
                {
                    case ESPTarget.Players:
                    case ESPTarget.Zombies:
                        b = new Bounds(new Vector3(position.x, position.y + 1, position.z),
                            new Vector3(scale.x * 2, scale.y * 3, scale.z * 2));
                        break;
                    case ESPTarget.Vehicles:

                        b = go.transform.Find("Model_0").GetComponent<MeshRenderer>().bounds;
                        Transform child = go.transform.Find("Model_1");

                        if (child != null)
                            b.Encapsulate(child.GetComponent<MeshRenderer>().bounds);

                        break;
                    default:
                        b = go.GetComponent<Collider>().bounds;
                        break;
                }

                int size = DrawUtilities.GetTextSize(visual, dist);
                double rounded = Math.Round(dist);

                /*#if DEBUG
				DebugUtilities.Log(obj.Target.ToString()); //Holy f**k nuggets this is laggy
				#endif*/

                string outerText = $"<size={size}>";
                text = $"<size={size}>";

                switch (obj.Target)
                {
                    #region Players

                    case ESPTarget.Players:
                        {
                            Player p = (Player)obj.Object;

                            if (p.life.isDead)
                                continue;

                            if (visual.ShowName)
                                text += GetSteamPlayer(p).playerID.characterName + "\n";
                            if (RaycastUtilities.TargetedPlayer == p && RaycastOptions.EnablePlayerSelection)
                                text += "[Targeted]\n";
                            if (ESPOptions.ShowPlayerWeapon)
                                text += (p.equipment.asset != null ? p.equipment.asset.itemName : "Fists") + "\n";
                            if (ESPOptions.ShowPlayerVehicle)
                                text += (p.movement.getVehicle() != null ? p.movement.getVehicle().asset.name + "\n" : "No Vehicle\n");
                            b.size = b.size / 2;
                            b.size = new Vector3(b.size.x, b.size.y * 1.25f, b.size.z);

                            if (FriendUtilities.IsFriendly(p) && ESPOptions.UsePlayerGroup)
                                c = ColorUtilities.getColor("_ESPFriendly");

                            break;
                        }

                    #endregion

                    #region Zombies

                    case ESPTarget.Zombies:
                        {
                            if (((Zombie)obj.Object).isDead)
                                continue;

                            if (visual.ShowName)
                                text += $"Zombie\n";

                            break;
                        }

                    #endregion

                    #region Items

                    case ESPTarget.Items:
                        {
                            InteractableItem item = (InteractableItem)obj.Object;

                            if (visual.ShowName)
                                text += item.asset.itemName + "\n";

                            break;
                        }

                    #endregion

                    #region Sentries

                    case ESPTarget.Sentries:
                        {
                            InteractableSentry sentry = (InteractableSentry)obj.Object;

                            if (visual.ShowName)
                            {
                                text += "Sentry\n";
                                outerText += "Sentry\n";
                            }

                            if (ESPOptions.ShowSentryItem)
                            {
                                outerText += SentryName(sentry.displayItem, false) + "\n";
                                text += SentryName(sentry.displayItem, true) + "\n";
                            }

                            break;
                        }

                    #endregion

                    #region Beds

                    case ESPTarget.Beds:
                        {
                            InteractableBed bed = (InteractableBed)obj.Object;

                            if (visual.ShowName)
                            {
                                text += "Bed\n";
                                outerText += "Bed\n";
                            }

                            if (ESPOptions.ShowClaimed)
                            {
                                text += GetOwned(bed, true) + "\n";
                                outerText += GetOwned(bed, false) + "\n";
                            }
                            break;
                        }

                    #endregion

                    #region Claim Flags

                    case ESPTarget.ClaimFlags:
                        {
                            if (visual.ShowName)
                                text += "Claim Flag\n";

                            break;
                        }

                    #endregion

                    #region Vehicles

                    case ESPTarget.Vehicles:
                        {
                            InteractableVehicle vehicle = (InteractableVehicle)obj.Object;

                            if (vehicle.health == 0)
                                continue;

                            if (ESPOptions.FilterVehicleLocked && vehicle.isLocked)
                                continue;

                            vehicle.getDisplayFuel(out ushort displayFuel, out ushort MaxFuel);

                            float health = Mathf.Round(100 * (vehicle.health / (float)vehicle.asset.health));
                            float fuel = Mathf.Round(100 * (displayFuel / (float)MaxFuel));

                            if (visual.ShowName)
                            {
                                text += vehicle.asset.name + "\n";
                                outerText += vehicle.asset.name + "\n";
                            }

                            if (ESPOptions.ShowVehicleHealth)
                            {
                                text += $"Health: {health}%\n";
                                outerText += $"Health: {health}%\n";
                            }

                            if (ESPOptions.ShowVehicleFuel)
                            {
                                text += $"Fuel: {fuel}%\n";
                                outerText += $"Fuel: {fuel}%\n";
                            }

                            if (ESPOptions.ShowVehicleLocked)
                            {
                                text += GetLocked(vehicle, true) + "\n";
                                outerText += GetLocked(vehicle, false) + "\n";
                            }

                            break;
                        }

                    #endregion

                    #region Storage

                    case ESPTarget.Storage:
                        {
                            if (visual.ShowName)
                                text += "Storage\n";

                            break;
                        }

                    #endregion

                    #region Generators

                    case ESPTarget.Generators:
                        {
                            InteractableGenerator gen = (InteractableGenerator)obj.Object;

                            float fuel = Mathf.Round(100 * (gen.fuel / (float)gen.capacity));

                            if (ESPOptions.ShowGeneratorFuel)
                            {
                                text += $"Fuel: {fuel}%\n";
                                outerText += $"Fuel: {fuel}%\n";
                            }

                            if (ESPOptions.ShowGeneratorPowered)
                            {
                                text += GetPowered(gen, true) + "\n";
                                outerText += GetPowered(gen, false) + "\n";
                            }

                            break;
                        }

                        #endregion
                }

                if (outerText == $"<size={size}>")
                    outerText = null;

                if (visual.ShowDistance)
                {
                    text += $"{rounded}m\n";

                    if (outerText != null)
                        outerText += $"{rounded}m\n";
                }

                if (visual.ShowAngle)
                {
                    double roundedFOV = Math.Round(VectorUtilities.GetAngleDelta(aimPos, aimForward, position), 2);
                    text += $"Angle: {roundedFOV}°\n";

                    if (outerText != null)
                        outerText += $"{roundedFOV}°\n";
                }

                text += "</size>";

                if (outerText != null)
                    outerText += "</size>";

                Vector3[] vectors = DrawUtilities.GetBoxVectors(b);

                Vector2[] W2SVectors = DrawUtilities.GetRectangleLines(MainCamera, b, c);
                Vector3 LabelVector = DrawUtilities.Get2DW2SVector(MainCamera, W2SVectors, ll);

                if (MirrorCameraOptions.Enabled && W2SVectors.Any(v => MirrorCameraComponent.viewport.Contains(v)))
                {
                    Highlighter highlighter = go.GetComponent<Highlighter>();
                    if (highlighter != null)
                        highlighter.ConstantOffImmediate();

                    continue;
                }

                if (visual.Boxes)
                {
                    if (visual.TwoDimensional)
                        DrawUtilities.PrepareRectangleLines(W2SVectors, c);
                    else
                    {
                        DrawUtilities.PrepareBoxLines(vectors, c);
                        LabelVector = DrawUtilities.Get3DW2SVector(MainCamera, b, ll);
                    }
                }

                if (visual.Glow)
                {
                    Highlighter highlighter = go.GetComponent<Highlighter>() ?? go.AddComponent<Highlighter>();
                    //highlighter.OccluderOn();
                    //highlighter.SeeThroughOn();

                    highlighter.occluder = true;
                    highlighter.overlay = true;
                    highlighter.ConstantOnImmediate(c);
                    Highlighters.Add(highlighter);
                }
                else
                {
                    Highlighter highlighter = go.GetComponent<Highlighter>();
                    if (highlighter != null && highlighter != TrajectoryComponent.Highlighted)
                        highlighter.ConstantOffImmediate();
                }

                if (visual.Labels)
                    DrawUtilities.DrawLabel(ESPFont, ll, LabelVector, text, visual.CustomTextColor ? ColorUtilities.getColor($"_{obj.Target}_Text") : c, ColorUtilities.getColor($"_{obj.Target}_Outline"), visual.BorderStrength, outerText);

                if (visual.LineToObject)
                    ESPVariables.DrawBuffer2.Enqueue(new ESPBox2
                    {
                        Color = c,
                        Vertices = new[]
                        {
                            new Vector2(Screen.width / 2, Screen.height),
                            new Vector2(cpos.x, Screen.height - cpos.y)
                        }
                    });
            }

            GLMat.SetPass(0);

            GL.PushMatrix();
            GL.LoadProjectionMatrix(MainCamera.projectionMatrix);
            GL.modelview = MainCamera.worldToCameraMatrix;
            GL.Begin(GL.LINES);

            for (int i = 0; i < ESPVariables.DrawBuffer.Count; i++)
            {
                ESPBox box = ESPVariables.DrawBuffer.Dequeue();
                GL.Color(box.Color);

                Vector3[] vertices = box.Vertices;
                for (int j = 0; j < vertices.Length; j++)
                    GL.Vertex(vertices[j]);

            }
            GL.End();
            GL.PopMatrix();

            GL.PushMatrix();
            GL.Begin(GL.LINES);

            for (int i = 0; i < ESPVariables.DrawBuffer2.Count; i++)
            {
                ESPBox2 box = ESPVariables.DrawBuffer2.Dequeue();

                GL.Color(box.Color);
                Vector2[] vertices = box.Vertices;

                bool Run = true;

                for (int j = 0; j < vertices.Length; j++)
                    if (j < vertices.Length - 1)
                    {
                        Vector2 v1 = vertices[j];
                        Vector2 v2 = vertices[j + 1];

                        if (Vector2.Distance(v2, v1) > Screen.width / 2)
                        {
                            Run = false;
                            break;
                        }
                    }

                if (!Run)
                    continue;

                for (int j = 0; j < vertices.Length; j++)
                    GL.Vertex3(vertices[j].x, vertices[j].y, 0);

            }
            GL.End();
            GL.PopMatrix();
        }
    public static IEnumerator UpdateObjectList()
    {
        for (; ;)
        {
            bool flag = !DrawUtilities.ShouldRun();
            if (flag)
            {
                yield return(new WaitForSeconds(2f));
            }
            else
            {
                List <ESPObject> objects = ESPVariables.Objects;
                objects.Clear();
                List <ESPTarget> targets = (from k in ESPOptions.PriorityTable.Keys
                                            orderby ESPOptions.PriorityTable[k] descending
                                            select k).ToList <ESPTarget>();
                int num;
                for (int i = 0; i < targets.Count; i = num + 1)
                {
                    ESPTarget target = targets[i];
                    ESPVisual vis    = ESPOptions.VisualOptions[(int)target];
                    bool      flag2  = !vis.Enabled;
                    if (!flag2)
                    {
                        Vector2 pPos = OptimizationVariables.MainPlayer.transform.position;
                        switch (target)
                        {
                        case ESPTarget.Игроки:
                        {
                            SteamPlayer[] objarray = (from p in Provider.clients
                                                      orderby VectorUtilities.GetDistance(pPos, p.player.transform.position) descending
                                                      select p).ToArray <SteamPlayer>();
                            bool useObjectCap = vis.UseObjectCap;
                            if (useObjectCap)
                            {
                                objarray = objarray.TakeLast(vis.ObjectCap).ToArray <SteamPlayer>();
                            }
                            for (int j = 0; j < objarray.Length; j = num + 1)
                            {
                                SteamPlayer sPlayer = objarray[j];
                                Player      plr     = sPlayer.player;
                                bool        flag3   = plr.life.isDead || plr == OptimizationVariables.MainPlayer;
                                if (!flag3)
                                {
                                    objects.Add(new ESPObject(target, plr, plr.gameObject));
                                    sPlayer = null;
                                    plr     = null;
                                }
                                num = j;
                            }
                            break;
                        }

                        case ESPTarget.Зомби:
                        {
                            Zombie[] objarr = (from obj in ZombieManager.regions.SelectMany((ZombieRegion r) => r.zombies)
                                               orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                               select obj).ToArray <Zombie>();
                            bool useObjectCap2 = vis.UseObjectCap;
                            if (useObjectCap2)
                            {
                                objarr = objarr.TakeLast(vis.ObjectCap).ToArray <Zombie>();
                            }
                            for (int k2 = 0; k2 < objarr.Length; k2 = num + 1)
                            {
                                Zombie obj9 = objarr[k2];
                                objects.Add(new ESPObject(target, obj9, obj9.gameObject));
                                obj9 = null;
                                num  = k2;
                            }
                            break;
                        }

                        case ESPTarget.Предметы:
                        {
                            InteractableItem[] objarr2 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableItem>()
                                                          orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                          select obj).ToArray <InteractableItem>();
                            bool useObjectCap3 = vis.UseObjectCap;
                            if (useObjectCap3)
                            {
                                objarr2 = objarr2.TakeLast(vis.ObjectCap).ToArray <InteractableItem>();
                            }
                            for (int l = 0; l < objarr2.Length; l = num + 1)
                            {
                                InteractableItem obj2  = objarr2[l];
                                bool             flag4 = ItemUtilities.Whitelisted(obj2.asset, ItemOptions.ItemESPOptions) || !ESPOptions.FilterItems;
                                if (flag4)
                                {
                                    objects.Add(new ESPObject(target, obj2, obj2.gameObject));
                                }
                                obj2 = null;
                                num  = l;
                            }
                            break;
                        }

                        case ESPTarget.Турели:
                        {
                            InteractableSentry[] objarr3 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableSentry>()
                                                            orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                            select obj).ToArray <InteractableSentry>();
                            bool useObjectCap4 = vis.UseObjectCap;
                            if (useObjectCap4)
                            {
                                objarr3 = objarr3.TakeLast(vis.ObjectCap).ToArray <InteractableSentry>();
                            }
                            for (int m = 0; m < objarr3.Length; m = num + 1)
                            {
                                InteractableSentry obj3 = objarr3[m];
                                objects.Add(new ESPObject(target, obj3, obj3.gameObject));
                                obj3 = null;
                                num  = m;
                            }
                            break;
                        }

                        case ESPTarget.Кровати:
                        {
                            InteractableBed[] objarr4 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableBed>()
                                                         orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                         select obj).ToArray <InteractableBed>();
                            bool useObjectCap5 = vis.UseObjectCap;
                            if (useObjectCap5)
                            {
                                objarr4 = objarr4.TakeLast(vis.ObjectCap).ToArray <InteractableBed>();
                            }
                            for (int n = 0; n < objarr4.Length; n = num + 1)
                            {
                                InteractableBed obj4 = objarr4[n];
                                objects.Add(new ESPObject(target, obj4, obj4.gameObject));
                                obj4 = null;
                                num  = n;
                            }
                            break;
                        }

                        case ESPTarget.КлеймФлаги:
                        {
                            InteractableClaim[] objarr5 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableClaim>()
                                                           orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                           select obj).ToArray <InteractableClaim>();
                            bool useObjectCap6 = vis.UseObjectCap;
                            if (useObjectCap6)
                            {
                                objarr5 = objarr5.TakeLast(vis.ObjectCap).ToArray <InteractableClaim>();
                            }
                            for (int j2 = 0; j2 < objarr5.Length; j2 = num + 1)
                            {
                                InteractableClaim obj5 = objarr5[j2];
                                objects.Add(new ESPObject(target, obj5, obj5.gameObject));
                                obj5 = null;
                                num  = j2;
                            }
                            break;
                        }

                        case ESPTarget.Транспорт:
                        {
                            InteractableVehicle[] objarr6 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableVehicle>()
                                                             orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                             select obj).ToArray <InteractableVehicle>();
                            bool useObjectCap7 = vis.UseObjectCap;
                            if (useObjectCap7)
                            {
                                objarr6 = objarr6.TakeLast(vis.ObjectCap).ToArray <InteractableVehicle>();
                            }
                            for (int j3 = 0; j3 < objarr6.Length; j3 = num + 1)
                            {
                                InteractableVehicle obj6 = objarr6[j3];
                                bool isDead = obj6.isDead;
                                if (!isDead)
                                {
                                    objects.Add(new ESPObject(target, obj6, obj6.gameObject));
                                    obj6 = null;
                                }
                                num = j3;
                            }
                            break;
                        }

                        case ESPTarget.Ящики:
                        {
                            InteractableStorage[] objarr7 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableStorage>()
                                                             orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                             select obj).ToArray <InteractableStorage>();
                            bool useObjectCap8 = vis.UseObjectCap;
                            if (useObjectCap8)
                            {
                                objarr7 = objarr7.TakeLast(vis.ObjectCap).ToArray <InteractableStorage>();
                            }
                            for (int j4 = 0; j4 < objarr7.Length; j4 = num + 1)
                            {
                                InteractableStorage obj7 = objarr7[j4];
                                objects.Add(new ESPObject(target, obj7, obj7.gameObject));
                                obj7 = null;
                                num  = j4;
                            }
                            break;
                        }

                        case ESPTarget.Генераторы:
                        {
                            InteractableGenerator[] objarr8 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableGenerator>()
                                                               orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                               select obj).ToArray <InteractableGenerator>();
                            bool useObjectCap9 = vis.UseObjectCap;
                            if (useObjectCap9)
                            {
                                objarr8 = objarr8.TakeLast(vis.ObjectCap).ToArray <InteractableGenerator>();
                            }
                            for (int j5 = 0; j5 < objarr8.Length; j5 = num + 1)
                            {
                                InteractableGenerator obj8 = objarr8[j5];
                                objects.Add(new ESPObject(target, obj8, obj8.gameObject));
                                obj8 = null;
                                num  = j5;
                            }
                            break;
                        }

                        case ESPTarget.Животные:
                        {
                            Animal[] objarr8 = (from obj in UnityEngine.Object.FindObjectsOfType <Animal>()
                                                orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                select obj).ToArray <Animal>();
                            bool useObjectCap9 = vis.UseObjectCap;
                            if (useObjectCap9)
                            {
                                objarr8 = objarr8.TakeLast(vis.ObjectCap).ToArray <Animal>();
                            }
                            for (int j5 = 0; j5 < objarr8.Length; j5 = num + 1)
                            {
                                Animal obj8 = objarr8[j5];
                                objects.Add(new ESPObject(target, obj8, obj8.gameObject));
                                obj8 = null;
                                num  = j5;
                            }
                            break;
                        }

                        case ESPTarget.Ловшуки:
                        {
                            InteractableTrap[] objarr8 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableTrap>()
                                                          orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                          select obj).ToArray <InteractableTrap>();
                            bool useObjectCap9 = vis.UseObjectCap;
                            if (useObjectCap9)
                            {
                                objarr8 = objarr8.TakeLast(vis.ObjectCap).ToArray <InteractableTrap>();
                            }
                            for (int j5 = 0; j5 < objarr8.Length; j5 = num + 1)
                            {
                                InteractableTrap obj8 = objarr8[j5];
                                objects.Add(new ESPObject(target, obj8, obj8.gameObject));
                                obj8 = null;
                                num  = j5;
                            }
                            break;
                        }

                        case ESPTarget.Аирдропы:
                        {
                            Carepackage[] objarr8 = (from obj in UnityEngine.Object.FindObjectsOfType <Carepackage>()
                                                     orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                     select obj).ToArray <Carepackage>();
                            bool useObjectCap9 = vis.UseObjectCap;
                            if (useObjectCap9)
                            {
                                objarr8 = objarr8.TakeLast(vis.ObjectCap).ToArray <Carepackage>();
                            }
                            for (int j5 = 0; j5 < objarr8.Length; j5 = num + 1)
                            {
                                Carepackage obj8 = objarr8[j5];
                                objects.Add(new ESPObject(target, obj8, obj8.gameObject));
                                obj8 = null;
                                num  = j5;
                            }
                            break;
                        }

                        case ESPTarget.Двери:
                        {
                            InteractableDoorHinge[] objarr8 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableDoorHinge>()
                                                               orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                               select obj).ToArray <InteractableDoorHinge>();
                            bool useObjectCap9 = vis.UseObjectCap;
                            if (useObjectCap9)
                            {
                                objarr8 = objarr8.TakeLast(vis.ObjectCap).ToArray <InteractableDoorHinge>();
                            }
                            for (int j5 = 0; j5 < objarr8.Length; j5 = num + 1)
                            {
                                InteractableDoorHinge obj8 = objarr8[j5];
                                objects.Add(new ESPObject(target, obj8, obj8.gameObject));
                                obj8 = null;
                                num  = j5;
                            }
                            break;
                        }

                        case ESPTarget.Ягоды:
                        {
                            InteractableForage[] objarr8 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableForage>()
                                                            orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                            select obj).ToArray <InteractableForage>();
                            bool useObjectCap9 = vis.UseObjectCap;
                            if (useObjectCap9)
                            {
                                objarr8 = objarr8.TakeLast(vis.ObjectCap).ToArray <InteractableForage>();
                            }
                            for (int j5 = 0; j5 < objarr8.Length; j5 = num + 1)
                            {
                                InteractableForage obj8 = objarr8[j5];
                                objects.Add(new ESPObject(target, obj8, obj8.gameObject));
                                obj8 = null;
                                num  = j5;
                            }
                            break;
                        }

                        case ESPTarget.астения:
                        {
                            InteractableFarm[] objarr8 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableFarm>()
                                                          orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                          select obj).ToArray <InteractableFarm>();
                            bool useObjectCap9 = vis.UseObjectCap;
                            if (useObjectCap9)
                            {
                                objarr8 = objarr8.TakeLast(vis.ObjectCap).ToArray <InteractableFarm>();
                            }
                            for (int j5 = 0; j5 < objarr8.Length; j5 = num + 1)
                            {
                                InteractableFarm obj8 = objarr8[j5];
                                objects.Add(new ESPObject(target, obj8, obj8.gameObject));
                                obj8 = null;
                                num  = j5;
                            }
                            break;
                        }

                        case ESPTarget.C4:
                        {
                            InteractableCharge[] objarr8 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableCharge>()
                                                            orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                            select obj).ToArray <InteractableCharge>();
                            bool useObjectCap9 = vis.UseObjectCap;
                            if (useObjectCap9)
                            {
                                objarr8 = objarr8.TakeLast(vis.ObjectCap).ToArray <InteractableCharge>();
                            }
                            for (int j5 = 0; j5 < objarr8.Length; j5 = num + 1)
                            {
                                InteractableCharge obj8 = objarr8[j5];
                                objects.Add(new ESPObject(target, obj8, obj8.gameObject));
                                obj8 = null;
                                num  = j5;
                            }
                            break;
                        }

                        case ESPTarget.Fire:
                        {
                            InteractableFire[] objarr8 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableFire>()
                                                          orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                          select obj).ToArray <InteractableFire>();
                            bool useObjectCap9 = vis.UseObjectCap;
                            if (useObjectCap9)
                            {
                                objarr8 = objarr8.TakeLast(vis.ObjectCap).ToArray <InteractableFire>();
                            }
                            for (int j5 = 0; j5 < objarr8.Length; j5 = num + 1)
                            {
                                InteractableFire obj8 = objarr8[j5];
                                objects.Add(new ESPObject(target, obj8, obj8.gameObject));
                                obj8 = null;
                                num  = j5;
                            }
                            break;
                        }

                        case ESPTarget.Лампы:
                        {
                            InteractableSpot[] objarr8 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableSpot>()
                                                          orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                          select obj).ToArray <InteractableSpot>();
                            bool useObjectCap9 = vis.UseObjectCap;
                            if (useObjectCap9)
                            {
                                objarr8 = objarr8.TakeLast(vis.ObjectCap).ToArray <InteractableSpot>();
                            }
                            for (int j5 = 0; j5 < objarr8.Length; j5 = num + 1)
                            {
                                InteractableSpot obj8 = objarr8[j5];
                                objects.Add(new ESPObject(target, obj8, obj8.gameObject));
                                obj8 = null;
                                num  = j5;
                            }
                            break;
                        }

                        case ESPTarget.Топливо:
                        {
                            InteractableObjectResource[] objarr8 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableObjectResource>()
                                                                    orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                                    select obj).ToArray <InteractableObjectResource>();
                            bool useObjectCap9 = vis.UseObjectCap;
                            if (useObjectCap9)
                            {
                                objarr8 = objarr8.TakeLast(vis.ObjectCap).ToArray <InteractableObjectResource>();
                            }
                            for (int j5 = 0; j5 < objarr8.Length; j5 = num + 1)
                            {
                                InteractableObjectResource obj8 = objarr8[j5];
                                objects.Add(new ESPObject(target, obj8, obj8.gameObject));
                                obj8 = null;
                                num  = j5;
                            }
                            break;
                        }

                        case ESPTarget.Генератор_безопасной_зоны:
                        {
                            InteractableSafezone[] objarr8 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableSafezone>()
                                                              orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                              select obj).ToArray <InteractableSafezone>();
                            bool useObjectCap9 = vis.UseObjectCap;
                            if (useObjectCap9)
                            {
                                objarr8 = objarr8.TakeLast(vis.ObjectCap).ToArray <InteractableSafezone>();
                            }
                            for (int j5 = 0; j5 < objarr8.Length; j5 = num + 1)
                            {
                                InteractableSafezone obj8 = objarr8[j5];
                                objects.Add(new ESPObject(target, obj8, obj8.gameObject));
                                obj8 = null;
                                num  = j5;
                            }
                            break;
                        }

                        case ESPTarget.Генератор_Воздуха:
                        {
                            InteractableOxygenator[] objarr8 = (from obj in UnityEngine.Object.FindObjectsOfType <InteractableOxygenator>()
                                                                orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                                select obj).ToArray <InteractableOxygenator>();
                            bool useObjectCap9 = vis.UseObjectCap;
                            if (useObjectCap9)
                            {
                                objarr8 = objarr8.TakeLast(vis.ObjectCap).ToArray <InteractableOxygenator>();
                            }
                            for (int j5 = 0; j5 < objarr8.Length; j5 = num + 1)
                            {
                                InteractableOxygenator obj8 = objarr8[j5];
                                objects.Add(new ESPObject(target, obj8, obj8.gameObject));
                                obj8 = null;
                                num  = j5;
                            }
                            break;
                        }

                        case ESPTarget.NPC:
                        {
                            ResourceManager[] objarr8 = (from obj in UnityEngine.Object.FindObjectsOfType <ResourceManager>()
                                                         orderby VectorUtilities.GetDistance(pPos, obj.transform.position) descending
                                                         select obj).ToArray <ResourceManager>();
                            bool useObjectCap9 = vis.UseObjectCap;
                            if (useObjectCap9)
                            {
                                objarr8 = objarr8.TakeLast(vis.ObjectCap).ToArray <ResourceManager>();
                            }
                            for (int j5 = 0; j5 < objarr8.Length; j5 = num + 1)
                            {
                                ResourceManager obj8 = objarr8[j5];
                                objects.Add(new ESPObject(target, obj8, obj8.gameObject));
                                obj8 = null;
                                num  = j5;
                            }
                            break;
                        }
                        }
                    }
                    num = i;
                }
                yield return(new WaitForSeconds(5f));

                objects = null;
                targets = null;
            }
        }
    }