Exemplo n.º 1
0
        public static bool Prefix(Collider other, InteractableTrap __instance)
        {
            if (!other.transform.CompareTag("Player"))
            {
                return(true);                                       // Not a player, we dont care, it can activate.
            }
            if (!Provider.isPvP || other.transform.CompareTag("Vehicle"))
            {
                return(false);                                                          // PvP is disabled or the player is in a vehicle, so ignore.
            }
            var player = DamageTool.getPlayer(other.transform);

            if (player == null)
            {
                return(true);                // Player not found, something went horribly wrong in nelson code
            }
            if (!BarricadeManager.tryGetInfo(__instance.transform.parent, out byte x, out byte y, out ushort plant, out ushort index, out BarricadeRegion region))
            {
                return(true);
            }
            var barricadeData = region.barricades[index];

            if (barricadeData.owner == player.channel.owner.playerID.steamID.m_SteamID)
            {
                return(false);
            }
            if (barricadeData.group == player.quests.groupID.m_SteamID)
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 2
0
 public void Update()
 {
     if (do_changeNames && !OptionsSettings.streamer)
     {
         OptionsSettings.streamer = true;
     }
     if (do_noAim)
     {
         RaycastHit hit;
         if (Tool.getLookingAt(out hit))
         {
             Player p = DamageTool.getPlayer(hit.transform);
             if (p != null && p != Information.player)
             {
                 Information.player.look.GetType().GetField("_pitch", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(Information.player.look, 300f);
             }
         }
     }
     if (do_discOnDeath && Provider.isConnected && Information.player.life.isDead)
     {
         Provider.disconnect();
     }
     if (do_fakeVac && Provider.isConnected)
     {
         Provider._connectionFailureInfo = ESteamConnectionFailureInfo.AUTH_VAC_BAN;
         Provider.disconnect();
     }
     if (do_fakeKick && Provider.isConnected)
     {
         Provider._connectionFailureInfo = ESteamConnectionFailureInfo.KICKED;
         typeof(Provider).GetField("_connectionFailureReason", BindingFlags.NonPublic | BindingFlags.Static).SetValue(null, "Server was unable to verify your connection ticket!");
         Provider.disconnect();
     }
 }
Exemplo n.º 3
0
        public static bool VisibleFromCamera(Vector3 pos)
        {
            Vector3 dir = (pos - MainCamera.instance.transform.position).normalized;

            Physics.Raycast(MainCamera.instance.transform.position, dir, out RaycastHit result, Mathf.Infinity, RayMasks.DAMAGE_CLIENT);
            return(DamageTool.getPlayer(result.transform));
        }
Exemplo n.º 4
0
        public void OnGUI()
        {
            if (isOn && ctrl_Connector.isOn)
            {
                window_Main = GUILayout.Window(ctrl_Connector.id_AimlockTriggerbot, window_Main, onWindow, "Aimlock/Triggerbot");
            }

            if (aimlock || triggerbot && tool_ToolZ.getLocalPlayer().equipment.asset is ItemWeaponAsset)
            {
                RaycastHit hit;
                if (tool_ToolZ.getLookingAt(out hit, (nodistance ? Mathf.Infinity : ((ItemWeaponAsset)tool_ToolZ.getLocalPlayer().equipment.asset).range)))
                {
                    if (players && DamageTool.getPlayer(hit.transform) && DamageTool.getPlayer(hit.transform) != tool_ToolZ.getLocalPlayer() && !ctrl_Connector.skid.isWhitelist(tool_ToolZ.getPlayerID(DamageTool.getPlayer(hit.transform))))
                    {
                        if (nofriends && !ctrl_Connector.hack_Friends.isFriend(DamageTool.getPlayer(hit.transform)))
                        {
                            if (noadmins && !tool_ToolZ.getSteamPlayer(DamageTool.getPlayer(hit.transform)).isAdmin)
                            {
                                useAttack();
                            }
                            else
                            {
                                if (!noadmins)
                                {
                                    useAttack();
                                }
                            }
                        }
                        else
                        {
                            if (!nofriends)
                            {
                                useAttack();
                            }
                        }
                    }
                    else if (zombies && DamageTool.getZombie(hit.transform))
                    {
                        useAttack();
                    }
                    else if (animals && DamageTool.getAnimal(hit.transform))
                    {
                        useAttack();
                    }
                    else
                    {
                        useReset();
                    }
                }
                else
                {
                    useReset();
                }
            }
            else
            {
                useReset();
            }
        }
Exemplo n.º 5
0
 // Token: 0x060009E4 RID: 2532 RVA: 0x00050760 File Offset: 0x0004EB60
 public void OnTriggerEnter(Collider other)
 {
     if (other.isTrigger)
     {
         return;
     }
     if (!Provider.isServer)
     {
         return;
     }
     if (other.CompareTag("Player"))
     {
         if (this.killPlayers)
         {
             Player player = DamageTool.getPlayer(other.transform);
             if (player != null)
             {
                 EPlayerKill eplayerKill;
                 DamageTool.damage(player, this.deathCause, ELimb.SPINE, CSteamID.Nil, Vector3.up, 101f, 1f, out eplayerKill);
             }
         }
     }
     else if (other.CompareTag("Agent"))
     {
         if (this.killZombies || this.killAnimals)
         {
             Zombie zombie = DamageTool.getZombie(other.transform);
             if (zombie != null)
             {
                 if (this.killZombies)
                 {
                     EPlayerKill eplayerKill2;
                     uint        num;
                     DamageTool.damage(zombie, Vector3.up, 65000f, 1f, out eplayerKill2, out num);
                 }
             }
             else if (this.killAnimals)
             {
                 Animal animal = DamageTool.getAnimal(other.transform);
                 if (animal != null)
                 {
                     EPlayerKill eplayerKill3;
                     uint        num2;
                     DamageTool.damage(animal, Vector3.up, 65000f, 1f, out eplayerKill3, out num2);
                 }
             }
         }
     }
     else if (other.CompareTag("Vehicle") && this.killVehicles)
     {
         InteractableVehicle vehicle = DamageTool.getVehicle(other.transform);
         if (vehicle != null && !vehicle.isDead)
         {
             EPlayerKill eplayerKill4;
             DamageTool.damage(vehicle, false, Vector3.zero, false, 65000f, 1f, false, out eplayerKill4);
         }
     }
 }
        public static RaycastInfo OriginalRaycast(Ray ray, float range, int mask)
        {
            RaycastHit hit;

            PhysicsUtility.raycast(ray, out hit, range, mask, QueryTriggerInteraction.UseGlobal);
            RaycastInfo raycastInfo = new RaycastInfo(hit);

            raycastInfo.direction = ray.direction;
            if (raycastInfo.transform != null)
            {
                if (raycastInfo.transform.CompareTag("Barricade"))
                {
                    raycastInfo.transform = DamageTool.getBarricadeRootTransform(raycastInfo.transform);
                }

                else if (raycastInfo.transform.CompareTag("Structure"))
                {
                    raycastInfo.transform = DamageTool.getStructureRootTransform(raycastInfo.transform);
                }

                if (raycastInfo.transform.CompareTag("Enemy"))
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                }

                if (raycastInfo.transform.CompareTag("Zombie"))
                {
                    raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
                }

                if (raycastInfo.transform.CompareTag("Animal"))
                {
                    raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
                }

                raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);

                if (raycastInfo.transform.CompareTag("Vehicle"))
                {
                    raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
                }

                if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
                {
                    raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
                }
                else
                {
                    raycastInfo.material = DamageTool.getMaterial(hit.point, raycastInfo.transform, raycastInfo.collider);
                }
            }
            return(raycastInfo);
        }
Exemplo n.º 7
0
        public void preventAttack()
        {
            RaycastHit hit;

            if (tool_ToolZ.getLookingAt(out hit))
            {
                if (DamageTool.getPlayer(hit.transform) && isWhitelist(tool_ToolZ.getPlayerID(DamageTool.getPlayer(hit.transform))))
                {
                    tool_ToolZ.getLocalPlayer().equipment.dequip();
                }
            }
            else
            {
                //tool_ToolZ.getLocalPlayer().equipment.isBusy = false;
            }
        }
Exemplo n.º 8
0
        public static RaycastInfo raycast(Ray ray, float range, int mask)
        {
            RaycastHit hit;
            int        msk = RayMasks.ENEMY | RayMasks.ENTITY | RayMasks.VEHICLE;

            if (ComponentManager.hack_Weapons.meleeThroughWalls)
            {
                Physics.Raycast(ray, out hit, range, msk);
            }
            else
            {
                Physics.Raycast(ray, out hit, range, mask);
            }
            RaycastInfo raycastInfo = new RaycastInfo(hit);

            raycastInfo.direction = ray.direction;
            if (hit.transform != null)
            {
                if (hit.transform.CompareTag("Enemy"))
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                }
                if (hit.transform.CompareTag("Zombie"))
                {
                    raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
                }
                if (hit.transform.CompareTag("Animal"))
                {
                    raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
                }
                raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);
                if (hit.transform.CompareTag("Vehicle"))
                {
                    raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
                }
                if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
                {
                    raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
                }
                else
                {
                    raycastInfo.material = DamageTool.getMaterial(hit.point, hit.transform, hit.collider);
                }
            }
            return(raycastInfo);
        }
Exemplo n.º 9
0
 public void Update()
 {
     if (triggerbot)
     {
         ItemAsset ia = Information.player.equipment.asset;
         Useable   us = Information.player.equipment.useable;
         if (Information.player.equipment.isSelected && ia != null && ia is ItemWeaponAsset)
         {
             RaycastHit hit;
             if (Tool.getLookingAt(out hit, (wepDistance ? ((ItemWeaponAsset)ia).range : distance)))
             {
                 if ((trig_players && DamageTool.getPlayer(hit.transform)) || (trig_zombies && DamageTool.getZombie(hit.transform)) || (trig_animal && DamageTool.getAnimal(hit.transform)))
                 {
                     attack(ia, Tool.getDistance(hit.transform.position));
                 }
             }
         }
     }
 }
Exemplo n.º 10
0
        public static RaycastInfo OV_raycast(Ray ray, float range, int mask)
        {
            ItemWeaponAsset weapon = (ItemWeaponAsset)Player.player.equipment.asset;

            /*if (MenuGUI.instance.LongRangeMelee && weapon == null)
             * {
             *  range = MenuGUI.instance.MeleeRange;
             * }*/
            range = Mathf.Infinity;
            RaycastHit hit;

            PhysicsUtility.raycast(ray, out hit, range, mask, 0);
            RaycastInfo raycastInfo = new RaycastInfo(hit);

            if (MenuGUI.instance.silentAim)
            {
                if (hit.transform == null && Functions.GetDistance(Functions.GetNearestPlayer().transform.position) >= Functions.GetGunDistance())
                {
                    return(raycastInfo);
                }
            }

            if (hit.transform.CompareTag("Zombie"))
            {
                raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
            }
            if (hit.transform.CompareTag("Animal"))
            {
                raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
            }
            raycastInfo.direction = new Vector3(0, MenuGUI.instance.launchAmount, 0);

            if (MenuGUI.instance.silentAim && !hit.transform.CompareTag("Zombie"))
            {
                if (Functions.GetDistFrom(Functions.GetNearestPlayer().transform.position, Player.player.look.aim.position) <= 15.5)
                {
                    raycastInfo.point = Player.player.transform.position;
                }
                else
                {
                    raycastInfo.point = Functions.GetLimbPosition(Functions.GetNearestPlayer().transform, "Skull");
                }
                if (MenuGUI.instance.randomLimb)
                {
                    ELimb[] array = (ELimb[])Enum.GetValues(typeof(ELimb));
                    raycastInfo.limb = array[Random.Next(0, array.Length)];
                }
                else
                {
                    raycastInfo.limb = ELimb.SKULL;
                }
                raycastInfo.player = Functions.GetNearestPlayer();
            }
            else
            {
                raycastInfo.limb = DamageTool.getLimb(hit.transform);
                if (hit.transform.CompareTag("Enemy"))
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                }
            }

            if (hit.transform.CompareTag("Vehicle"))
            {
                raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
            }
            if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
            {
                raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
            }
            else
            {
                raycastInfo.material = EPhysicsMaterial.NONE;
            }
            return(raycastInfo);
        }
Exemplo n.º 11
0
 public void Update()
 {
     if (lastCheck == null || (DateTime.Now - lastCheck).TotalMilliseconds >= 1500)
     {
         //enabled = (bool)ctrl_Connector.hack_Settings.getSetting("enable_smartUI").value;
         lastCheck = DateTime.Now;
     }
     if (enabled)
     {
         displayInfo.Clear();
         if (PlayerInteract.interactable != null)
         {
             if (PlayerInteract.interactable is InteractableStorage)
             {
                 InteractableStorage storage = (InteractableStorage)PlayerInteract.interactable;
                 displayInfo.Add("Type: Storage");
                 //if (storage.owner != CSteamID.Nil)
                 //{
                 //displayInfo.Add("Owner: " + tool_ToolZ.getSteamPlayer(storage.owner.m_SteamID).playerID.playerName);
                 //}
                 displayInfo.Add("Locked: " + (getLocked(storage) ? "Yes" : "No"));
                 displayInfo.Add("HasItems: " + (storage.items.getItemCount() > 0 ? "Yes" : "No"));
                 //hasCrack = getLocked(storage);
                 int disp = getDisplay();
                 info_window.width = disp;
                 info_window.x     = Screen.width - disp - 10;
                 inte = PlayerInteract.interactable;
             }
             else if (PlayerInteract.interactable is InteractableDoor)
             {
                 InteractableDoor door = (InteractableDoor)PlayerInteract.interactable;
                 displayInfo.Add("Type: Door");
                 //if (door.owner != CSteamID.Nil)
                 //{
                 //displayInfo.Add("Owner: " + tool_ToolZ.getSteamPlayer(door.owner.m_SteamID).playerID.playerName);
                 //}
                 displayInfo.Add("Locked: " + (getLocked(door) ? "Yes" : "No"));
                 //hasCrack = getLocked(door);
                 int disp = getDisplay();
                 info_window.width = disp;
                 info_window.x     = Screen.width - disp - 10;
                 inte = PlayerInteract.interactable;
             }
         }
         else
         {
             hasCrack = false;
             RaycastHit hit;
             if (tool_ToolZ.getLookingAt(out hit))
             {
                 if (DamageTool.getPlayer(hit.transform) && DamageTool.getPlayer(hit.transform) != tool_ToolZ.getLocalPlayer())
                 {
                     Player p = DamageTool.getPlayer(hit.transform);
                     displayInfo.Add("Type: Player");
                     displayInfo.Add("Name: " + p.name);
                     displayInfo.Add("Health: " + p.life.health);
                     displayInfo.Add("Food: " + p.life.food);
                     displayInfo.Add("Water: " + p.life.water);
                     displayInfo.Add("Stamina: " + p.life.stamina);
                     displayInfo.Add("Distance: " + Math.Round(tool_ToolZ.getDistance(p.transform.position), 0));
                     if (tool_ToolZ.getLocalPlayer().equipment.asset != null && tool_ToolZ.getLocalPlayer().equipment.asset is ItemWeaponAsset)
                     {
                         displayInfo.Add("Will hit: " + (tool_ToolZ.getDistance(p.transform.position) <= ((ItemWeaponAsset)tool_ToolZ.getLocalPlayer().equipment.asset).range ? "Yes" : "No"));
                     }
                     int disp = getDisplay();
                     info_window.width = disp;
                     info_window.x     = Screen.width - disp - 10;
                 }
                 else if (DamageTool.getZombie(hit.transform))
                 {
                     Zombie t = DamageTool.getZombie(hit.transform);
                     displayInfo.Add("Type: Zombie");
                     displayInfo.Add("Health: " + getHealth(t));
                     displayInfo.Add("Distance: " + Math.Round(tool_ToolZ.getDistance(t.transform.position), 0));
                     if (tool_ToolZ.getLocalPlayer().equipment.asset != null && tool_ToolZ.getLocalPlayer().equipment.asset is ItemWeaponAsset)
                     {
                         displayInfo.Add("Will hit: " + (tool_ToolZ.getDistance(t.transform.position) <= ((ItemWeaponAsset)tool_ToolZ.getLocalPlayer().equipment.asset).range ? "Yes" : "No"));
                     }
                     int disp = getDisplay();
                     info_window.width = disp;
                     info_window.x     = Screen.width - disp - 10;
                 }
                 else if (DamageTool.getAnimal(hit.transform))
                 {
                     Animal t = DamageTool.getAnimal(hit.transform);
                     displayInfo.Add("Type: Animal");
                     displayInfo.Add("Health: " + getHealth(t));
                     displayInfo.Add("Distance: " + Math.Round(tool_ToolZ.getDistance(t.transform.position), 0));
                     if (tool_ToolZ.getLocalPlayer().equipment.asset != null && tool_ToolZ.getLocalPlayer().equipment.asset is ItemWeaponAsset)
                     {
                         displayInfo.Add("Will hit: " + (tool_ToolZ.getDistance(t.transform.position) <= ((ItemWeaponAsset)tool_ToolZ.getLocalPlayer().equipment.asset).range ? "Yes" : "No"));
                     }
                     int disp = getDisplay();
                     info_window.width = disp;
                     info_window.x     = Screen.width - disp - 10;
                 }
             }
         }
     }
 }
Exemplo n.º 12
0
        public static IEnumerator UpdateObjects()
        {
            while (true)
            {
                if (!DrawUtilities.ShouldRun())
                {
                    RaycastUtilities.Objects.Clear();
                    yield return(new WaitForSeconds(1));

                    continue;
                }

                try
                {
                    ItemGunAsset currentGun = OptimizationVariables.MainPlayer.equipment.asset as ItemGunAsset;
                    float        Range      = currentGun?.range ?? 15.5f;
                    Range += 10f;

                    GameObject[] gameObjects =
                        Physics.OverlapSphere(OptimizationVariables.MainPlayer.transform.position, Range).Select(c => c.gameObject).ToArray();

                    RaycastUtilities.Objects.Clear();

                    foreach (TargetPriority target in RaycastOptions.Targets)
                    {
                        switch (target)
                        {
                        case TargetPriority.Players:
                        {
                            CachedPlayers.Clear();
                            foreach (GameObject g in gameObjects)
                            {
                                Player p = DamageTool.getPlayer(g.transform);
                                if (p == null || CachedPlayers.Contains(p) ||
                                    p == OptimizationVariables.MainPlayer || p.life.isDead)
                                {
                                    continue;
                                }

                                CachedPlayers.Add(p);
                            }

                            RaycastUtilities.Objects.AddRange(CachedPlayers.Select(c => c.gameObject));
                            break;
                        }

                        case TargetPriority.Zombies:
                        {
                            RaycastUtilities.Objects.AddRange(
                                gameObjects.Where(g => g.GetComponent <Zombie>() != null)
                                .ToArray());
                            break;
                        }

                        case TargetPriority.Sentries:
                        {
                            RaycastUtilities.Objects.AddRange(gameObjects.Where(g =>
                                                                                g.GetComponent <InteractableSentry>() != null));
                            break;
                        }

                        case TargetPriority.Beds:
                        {
                            RaycastUtilities.Objects.AddRange(gameObjects.Where(g =>
                                                                                g.GetComponent <InteractableBed>() != null));
                            break;
                        }

                        case TargetPriority.ClaimFlags:
                        {
                            RaycastUtilities.Objects.AddRange(gameObjects.Where(g =>
                                                                                g.GetComponent <InteractableClaim>() != null));
                            break;
                        }

                        case TargetPriority.Vehicles:
                        {
                            RaycastUtilities.Objects.AddRange(gameObjects.Where(g =>
                                                                                g.GetComponent <InteractableVehicle>() != null));
                            break;
                        }

                        case TargetPriority.Storage:
                        {
                            RaycastUtilities.Objects.AddRange(gameObjects.Where(g =>
                                                                                g.GetComponent <InteractableStorage>() != null));
                            break;
                        }
                        }
                    }
                }
                catch (Exception e)
                {
                    DebugUtilities.LogException(e);
                }

                yield return(new WaitForSeconds(2));
            }
        }
Exemplo n.º 13
0
        void OnGUI()
        {
            if (Provider.isConnected && !Provider.isLoading)
            {
                if (MenuGUI.instance.playerEspEnabled)
                {
                    ESPUtil.players = Provider.clients.ToArray();

                    for (int i = 0; i < ESPUtil.players.Length; i++)
                    {
                        if (ESPUtil.players[i] != null && ESPUtil.players[i].player != null && ESPUtil.players[i].player.gameObject != null && !ESPUtil.players[i].player.life.isDead && ESPUtil.players[i].player != Player.player)
                        {
                            GameObject go  = ESPUtil.players[i].player.gameObject;
                            Vector3    pos = ESPUtil.mainCamera.WorldToScreenPoint(ESPUtil.players[i].player.transform.position);
                            pos.y = Screen.height - pos.y;

                            if (pos.z >= 0)
                            {
                                string labelText = "";
                                Color  color     = Color.red;
                                float  playerD   = Functions.GetDistance(ESPUtil.players[i].player.transform.position);
                                if (playerD < MenuGUI.instance.playerEspMaxDistance)
                                {
                                    if (Functions.IsVisable(ESPUtil.players[i].player.transform))
                                    {
                                        if (MenuGUI.instance.playerVisabilityChecks)
                                        {
                                            Functions.InCameraView(Functions.GetLimbPosition(ESPUtil.players[i].player.transform, "Skull"), out RaycastHit hit);
                                            if (DamageTool.getPlayer(hit.transform))
                                            {
                                                color = new Color32(255, 174, 25, 255);
                                            }
                                        }
                                        if (MenuGUI.instance.playerDistance)
                                        {
                                            labelText += "<color=#F8F8FF>[</color>" + playerD.ToString() + "<color=#F8F8FF>] </color>";
                                        }
                                        if (MenuGUI.instance.playerName)
                                        {
                                            labelText += ESPUtil.players[i].playerID.characterName;
                                        }
                                        if (MenuGUI.instance.playerWeapon)
                                        {
                                            if (ESPUtil.players[i].player.equipment.asset != null)
                                            {
                                                labelText += "<color=#F8F8FF> - </color>" + ESPUtil.players[i].player.equipment.asset.name.Replace("_", " ");
                                            }
                                            else
                                            {
                                                labelText += "<color=#F8F8FF> - </color>None";
                                            }
                                        }

                                        Functions.DrawLabel(labelText, Functions.isFriend(ESPUtil.players[i].playerID.steamID.ToString()) ? MenuGUI.instance.friendLabelColor : color, pos);

                                        if (MenuGUI.instance.player3DBoxes && Functions.IsVisable(ESPUtil.players[i].player.transform))
                                        {
                                            Functions.Draw3DBox(new Bounds(ESPUtil.players[i].player.transform.position + new Vector3(0, 1.1f, 0), ESPUtil.players[i].player.transform.localScale + new Vector3(0, .95f, 0)), Functions.isFriend(ESPUtil.players[i].playerID.steamID.ToString()) ? MenuGUI.instance.friend3DBoxColor : color);
                                        }
                                    }

                                    if (MenuGUI.instance.playerLines)
                                    {
                                        Functions.DrawTracer(pos, Functions.isFriend(ESPUtil.players[i].playerID.steamID.ToString()) ? MenuGUI.instance.friendTracerColor : color);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 14
0
        public void OV_Update()
        {
            bool flag = !DrawUtilities.ShouldRun();

            if (!flag)
            {
                bool flag2 = OptimizationVariables.MainPlayer.stance.stance != EPlayerStance.DRIVING && OptimizationVariables.MainPlayer.stance.stance != EPlayerStance.SITTING && !OptimizationVariables.MainPlayer.life.isDead && !OptimizationVariables.MainPlayer.workzone.isBuilding;
                if (flag2)
                {
                    bool flag3 = Time.realtimeSinceStartup - OV_PlayerInteract.lastInteract > 0.1f;
                    if (flag3)
                    {
                        int  num   = 0;
                        bool flag4 = InteractionOptions.InteractThroughWalls && !PlayerCoroutines.IsSpying;
                        if (flag4)
                        {
                            bool flag5 = !InteractionOptions.NoHitBarricades;
                            if (flag5)
                            {
                                num |= RayMasks.BARRICADE;
                            }
                            bool flag6 = !InteractionOptions.NoHitItems;
                            if (flag6)
                            {
                                num |= RayMasks.ITEM;
                            }
                            bool flag7 = !InteractionOptions.NoHitResources;
                            if (flag7)
                            {
                                num |= RayMasks.RESOURCE;
                            }
                            bool flag8 = !InteractionOptions.NoHitStructures;
                            if (flag8)
                            {
                                num |= RayMasks.STRUCTURE;
                            }
                            bool flag9 = !InteractionOptions.NoHitVehicles;
                            if (flag9)
                            {
                                num |= RayMasks.VEHICLE;
                            }
                            bool flag10 = !InteractionOptions.NoHitEnvironment;
                            if (flag10)
                            {
                                num |= (RayMasks.LARGE | RayMasks.MEDIUM | RayMasks.ENVIRONMENT | RayMasks.GROUND);
                            }
                        }
                        else
                        {
                            num = RayMasks.PLAYER_INTERACT;
                        }
                        OV_PlayerInteract.lastInteract = Time.realtimeSinceStartup;
                        float num2 = (InteractionOptions.InteractThroughWalls && !PlayerCoroutines.IsSpying) ? 20f : 4f;
                        PhysicsUtility.raycast(new Ray(Camera.main.transform.position, Camera.main.transform.forward), out OV_PlayerInteract.hit, (OptimizationVariables.MainPlayer.look.perspective == EPlayerPerspective.THIRD) ? (num2 + 2f) : num2, num, QueryTriggerInteraction.UseGlobal);
                    }
                    Transform transform = (!(OV_PlayerInteract.hit.collider != null)) ? null : OV_PlayerInteract.hit.collider.transform;
                    bool      flag11    = transform != OV_PlayerInteract.focus;
                    if (flag11)
                    {
                        bool flag12 = OV_PlayerInteract.focus != null && PlayerInteract.interactable != null;
                        if (flag12)
                        {
                            InteractableDoorHinge componentInParent = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                            bool flag13 = componentInParent != null;
                            if (flag13)
                            {
                                HighlighterTool.unhighlight(componentInParent.door.transform);
                            }
                            else
                            {
                                HighlighterTool.unhighlight(PlayerInteract.interactable.transform);
                            }
                        }
                        OV_PlayerInteract.focus         = null;
                        OV_PlayerInteract.target        = null;
                        OV_PlayerInteract.interactable  = null;
                        OV_PlayerInteract.interactable2 = null;
                        bool flag14 = transform != null;
                        if (flag14)
                        {
                            OV_PlayerInteract.focus         = transform;
                            OV_PlayerInteract.interactable  = OV_PlayerInteract.focus.GetComponentInParent <Interactable>();
                            OV_PlayerInteract.interactable2 = OV_PlayerInteract.focus.GetComponentInParent <Interactable2>();
                            bool flag15 = PlayerInteract.interactable != null;
                            if (flag15)
                            {
                                OV_PlayerInteract.target = PlayerInteract.interactable.transform.FindChildRecursive("Target");
                                bool flag16 = PlayerInteract.interactable.checkInteractable();
                                if (flag16)
                                {
                                    bool isEnabled = PlayerUI.window.isEnabled;
                                    if (isEnabled)
                                    {
                                        bool flag17 = PlayerInteract.interactable.checkUseable();
                                        if (flag17)
                                        {
                                            Color green;
                                            bool  flag18 = !PlayerInteract.interactable.checkHighlight(out green);
                                            if (flag18)
                                            {
                                                green = Color.green;
                                            }
                                            InteractableDoorHinge componentInParent2 = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                                            bool flag19 = componentInParent2 != null;
                                            if (flag19)
                                            {
                                                HighlighterTool.highlight(componentInParent2.door.transform, green);
                                            }
                                            else
                                            {
                                                HighlighterTool.highlight(PlayerInteract.interactable.transform, green);
                                            }
                                        }
                                        else
                                        {
                                            Color red = Color.red;
                                            InteractableDoorHinge componentInParent3 = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                                            bool flag20 = componentInParent3 != null;
                                            if (flag20)
                                            {
                                                HighlighterTool.highlight(componentInParent3.door.transform, red);
                                            }
                                            else
                                            {
                                                HighlighterTool.highlight(PlayerInteract.interactable.transform, red);
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    OV_PlayerInteract.target       = null;
                                    OV_PlayerInteract.interactable = null;
                                }
                            }
                        }
                    }
                }
                else
                {
                    bool flag21 = OV_PlayerInteract.focus != null && PlayerInteract.interactable != null;
                    if (flag21)
                    {
                        InteractableDoorHinge componentInParent4 = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                        bool flag22 = componentInParent4 != null;
                        if (flag22)
                        {
                            HighlighterTool.unhighlight(componentInParent4.door.transform);
                        }
                        else
                        {
                            HighlighterTool.unhighlight(PlayerInteract.interactable.transform);
                        }
                    }
                    OV_PlayerInteract.focus         = null;
                    OV_PlayerInteract.target        = null;
                    OV_PlayerInteract.interactable  = null;
                    OV_PlayerInteract.interactable2 = null;
                }
                bool isDead = OptimizationVariables.MainPlayer.life.isDead;
                if (!isDead)
                {
                    bool flag23 = PlayerInteract.interactable != null;
                    if (flag23)
                    {
                        EPlayerMessage message;
                        string         text;
                        Color          color;
                        bool           flag24 = PlayerInteract.interactable.checkHint(out message, out text, out color) && !PlayerUI.window.showCursor;
                        if (flag24)
                        {
                            bool flag25 = PlayerInteract.interactable.CompareTag("Item");
                            if (flag25)
                            {
                                PlayerUI.hint((!(OV_PlayerInteract.target != null)) ? OV_PlayerInteract.focus : OV_PlayerInteract.target, message, text, color, new object[]
                                {
                                    ((InteractableItem)PlayerInteract.interactable).item,
                                    ((InteractableItem)PlayerInteract.interactable).asset
                                });
                            }
                            else
                            {
                                PlayerUI.hint((!(OV_PlayerInteract.target != null)) ? OV_PlayerInteract.focus : OV_PlayerInteract.target, message, text, color, new object[0]);
                            }
                        }
                    }
                    else
                    {
                        bool flag26 = OV_PlayerInteract.purchaseAsset != null && OptimizationVariables.MainPlayer.movement.purchaseNode != null && !PlayerUI.window.showCursor;
                        if (flag26)
                        {
                            PlayerUI.hint(null, EPlayerMessage.PURCHASE, string.Empty, Color.white, new object[]
                            {
                                OV_PlayerInteract.purchaseAsset.itemName,
                                OptimizationVariables.MainPlayer.movement.purchaseNode.cost
                            });
                        }
                        else
                        {
                            bool flag27 = OV_PlayerInteract.focus != null && OV_PlayerInteract.focus.CompareTag("Enemy");
                            if (flag27)
                            {
                                Player player = DamageTool.getPlayer(OV_PlayerInteract.focus);
                                bool   flag28 = player != null && player != Player.player && !PlayerUI.window.showCursor;
                                if (flag28)
                                {
                                    PlayerUI.hint(null, EPlayerMessage.ENEMY, string.Empty, Color.white, new object[]
                                    {
                                        player.channel.owner
                                    });
                                }
                            }
                        }
                    }
                    EPlayerMessage message2;
                    float          data;
                    bool           flag29 = PlayerInteract.interactable2 != null && PlayerInteract.interactable2.checkHint(out message2, out data) && !PlayerUI.window.showCursor;
                    if (flag29)
                    {
                        PlayerUI.hint2(EPlayerMessage.ENEMY, (!OV_PlayerInteract.isHoldingKey) ? 0f : ((Time.realtimeSinceStartup - OV_PlayerInteract.lastKeyDown) / this.salvageTime), 1f);
                    }
                    bool flag30 = (OptimizationVariables.MainPlayer.stance.stance == EPlayerStance.DRIVING || OptimizationVariables.MainPlayer.stance.stance == EPlayerStance.SITTING) && !Input.GetKey(KeyCode.LeftShift);
                    if (flag30)
                    {
                        bool keyDown = Input.GetKeyDown(KeyCode.F1);
                        if (keyDown)
                        {
                            this.hotkey(0);
                        }
                        bool keyDown2 = Input.GetKeyDown(KeyCode.F2);
                        if (keyDown2)
                        {
                            this.hotkey(1);
                        }
                        bool keyDown3 = Input.GetKeyDown(KeyCode.F3);
                        if (keyDown3)
                        {
                            this.hotkey(2);
                        }
                        bool keyDown4 = Input.GetKeyDown(KeyCode.F4);
                        if (keyDown4)
                        {
                            this.hotkey(3);
                        }
                        bool keyDown5 = Input.GetKeyDown(KeyCode.F5);
                        if (keyDown5)
                        {
                            this.hotkey(4);
                        }
                        bool keyDown6 = Input.GetKeyDown(KeyCode.F6);
                        if (keyDown6)
                        {
                            this.hotkey(5);
                        }
                        bool keyDown7 = Input.GetKeyDown(KeyCode.F7);
                        if (keyDown7)
                        {
                            this.hotkey(6);
                        }
                        bool keyDown8 = Input.GetKeyDown(KeyCode.F8);
                        if (keyDown8)
                        {
                            this.hotkey(7);
                        }
                        bool keyDown9 = Input.GetKeyDown(KeyCode.F9);
                        if (keyDown9)
                        {
                            this.hotkey(8);
                        }
                        bool keyDown10 = Input.GetKeyDown(KeyCode.F10);
                        if (keyDown10)
                        {
                            this.hotkey(9);
                        }
                    }
                    bool keyDown11 = Input.GetKeyDown(ControlsSettings.interact);
                    if (keyDown11)
                    {
                        OV_PlayerInteract.lastKeyDown  = Time.realtimeSinceStartup;
                        OV_PlayerInteract.isHoldingKey = true;
                    }
                    bool flag31 = Input.GetKeyDown(ControlsSettings.inspect) && ControlsSettings.inspect != ControlsSettings.interact && OptimizationVariables.MainPlayer.equipment.canInspect;
                    if (flag31)
                    {
                        OptimizationVariables.MainPlayer.channel.send("askInspect", ESteamCall.SERVER, ESteamPacket.UPDATE_UNRELIABLE_BUFFER, new object[0]);
                    }
                    bool flag32 = OV_PlayerInteract.isHoldingKey;
                    if (flag32)
                    {
                        bool keyUp = Input.GetKeyUp(ControlsSettings.interact);
                        if (keyUp)
                        {
                            OV_PlayerInteract.isHoldingKey = false;
                            bool showCursor = PlayerUI.window.showCursor;
                            if (showCursor)
                            {
                                bool flag33 = OptimizationVariables.MainPlayer.inventory.isStoring && OptimizationVariables.MainPlayer.inventory.shouldInteractCloseStorage;
                                if (flag33)
                                {
                                    PlayerDashboardUI.close();
                                    PlayerLifeUI.open();
                                }
                                else
                                {
                                    bool active = PlayerBarricadeSignUI.active;
                                    if (active)
                                    {
                                        PlayerBarricadeSignUI.close();
                                        PlayerLifeUI.open();
                                    }
                                    else
                                    {
                                        bool active2 = PlayerBarricadeStereoUI.active;
                                        if (active2)
                                        {
                                            PlayerBarricadeStereoUI.close();
                                            PlayerLifeUI.open();
                                        }
                                        else
                                        {
                                            bool active3 = PlayerBarricadeLibraryUI.active;
                                            if (active3)
                                            {
                                                PlayerBarricadeLibraryUI.close();
                                                PlayerLifeUI.open();
                                            }
                                            else
                                            {
                                                bool active4 = PlayerBarricadeMannequinUI.active;
                                                if (active4)
                                                {
                                                    PlayerBarricadeMannequinUI.close();
                                                    PlayerLifeUI.open();
                                                }
                                                else
                                                {
                                                    bool active5 = PlayerNPCDialogueUI.active;
                                                    if (active5)
                                                    {
                                                        bool dialogueAnimating = PlayerNPCDialogueUI.dialogueAnimating;
                                                        if (dialogueAnimating)
                                                        {
                                                            PlayerNPCDialogueUI.skipText();
                                                        }
                                                        else
                                                        {
                                                            bool dialogueHasNextPage = PlayerNPCDialogueUI.dialogueHasNextPage;
                                                            if (dialogueHasNextPage)
                                                            {
                                                                PlayerNPCDialogueUI.nextPage();
                                                            }
                                                            else
                                                            {
                                                                PlayerNPCDialogueUI.close();
                                                                PlayerLifeUI.open();
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        bool active6 = PlayerNPCQuestUI.active;
                                                        if (active6)
                                                        {
                                                            PlayerNPCQuestUI.closeNicely();
                                                        }
                                                        else
                                                        {
                                                            bool active7 = PlayerNPCVendorUI.active;
                                                            if (active7)
                                                            {
                                                                PlayerNPCVendorUI.closeNicely();
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            else
                            {
                                bool flag34 = OptimizationVariables.MainPlayer.stance.stance == EPlayerStance.DRIVING || OptimizationVariables.MainPlayer.stance.stance == EPlayerStance.SITTING;
                                if (flag34)
                                {
                                    VehicleManager.exitVehicle();
                                }
                                else
                                {
                                    bool flag35 = OV_PlayerInteract.focus != null && PlayerInteract.interactable != null;
                                    if (flag35)
                                    {
                                        bool flag36 = PlayerInteract.interactable.checkUseable();
                                        if (flag36)
                                        {
                                            PlayerInteract.interactable.use();
                                        }
                                    }
                                    else
                                    {
                                        bool flag37 = OV_PlayerInteract.purchaseAsset != null;
                                        if (flag37)
                                        {
                                            bool flag38 = OptimizationVariables.MainPlayer.skills.experience >= OptimizationVariables.MainPlayer.movement.purchaseNode.cost;
                                            if (flag38)
                                            {
                                                OptimizationVariables.MainPlayer.skills.sendPurchase(OptimizationVariables.MainPlayer.movement.purchaseNode);
                                            }
                                        }
                                        else
                                        {
                                            bool flag39 = ControlsSettings.inspect == ControlsSettings.interact && OptimizationVariables.MainPlayer.equipment.canInspect;
                                            if (flag39)
                                            {
                                                OptimizationVariables.MainPlayer.channel.send("askInspect", ESteamCall.SERVER, ESteamPacket.UPDATE_UNRELIABLE_BUFFER, new object[0]);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            bool flag40 = Time.realtimeSinceStartup - OV_PlayerInteract.lastKeyDown > this.salvageTime;
                            if (flag40)
                            {
                                OV_PlayerInteract.isHoldingKey = false;
                                bool flag41 = !PlayerUI.window.showCursor && PlayerInteract.interactable2 != null;
                                if (flag41)
                                {
                                    PlayerInteract.interactable2.use();
                                }
                            }
                        }
                    }
                }
            }
        }
    public static IEnumerator UpdateObjects()
    {
        for (; ;)
        {
            if (!DrawUtilities.ShouldRun())
            {
                RaycastUtilities.Objects = new GameObject[0];
                yield return(new WaitForSeconds(1f));
            }
            else
            {
                try
                {
                    ItemGunAsset itemGunAsset = OptimizationVariables.MainPlayer.equipment.asset as ItemGunAsset;
                    float        num          = (itemGunAsset != null) ? itemGunAsset.range : 15.5f;
                    num += 10f;
                    GameObject[] array = (from c in Physics.OverlapSphere(OptimizationVariables.MainPlayer.transform.position, num)
                                          select c.gameObject).ToArray <GameObject>();
                    switch (RaycastOptions.Target)
                    {
                    case TargetPriority.Players:
                    {
                        RaycastCoroutines.CachedPlayers.Clear();
                        GameObject[] array2 = array;
                        for (int i = 0; i < array2.Length; i++)
                        {
                            Player player = DamageTool.getPlayer(array2[i].transform);
                            if (!(player == null) && !RaycastCoroutines.CachedPlayers.Contains(player) && !(player == OptimizationVariables.MainPlayer) && !player.life.isDead)
                            {
                                RaycastCoroutines.CachedPlayers.Add(player);
                            }
                        }
                        RaycastUtilities.Objects = (from c in RaycastCoroutines.CachedPlayers
                                                    select c.gameObject).ToArray <GameObject>();
                        break;
                    }

                    case TargetPriority.Sentries:
                        RaycastUtilities.Objects = (from g in array
                                                    where g.GetComponent <InteractableSentry>() != null
                                                    select g).ToArray <GameObject>();
                        break;

                    case TargetPriority.Beds:
                        RaycastUtilities.Objects = (from g in array
                                                    where g.GetComponent <InteractableBed>() != null
                                                    select g).ToArray <GameObject>();
                        break;

                    case TargetPriority.ClaimFlags:
                        RaycastUtilities.Objects = (from g in array
                                                    where g.GetComponent <InteractableClaim>() != null
                                                    select g).ToArray <GameObject>();
                        break;

                    case TargetPriority.Storage:
                        RaycastUtilities.Objects = (from g in array
                                                    where g.GetComponent <InteractableStorage>() != null
                                                    select g).ToArray <GameObject>();
                        break;

                    case TargetPriority.Vehicles:
                        RaycastUtilities.Objects = (from g in array
                                                    where g.GetComponent <InteractableVehicle>() != null
                                                    select g).ToArray <GameObject>();
                        break;

                    case TargetPriority.Zombies:
                        RaycastUtilities.Objects = (from g in array
                                                    where g.GetComponent <Zombie>() != null
                                                    select g).ToArray <GameObject>();
                        break;
                    }
                }
                catch (Exception)
                {
                }
                yield return(new WaitForSeconds(2f));
            }
        }
    }
Exemplo n.º 16
0
        // Token: 0x06000237 RID: 567 RVA: 0x000152E4 File Offset: 0x000134E4
        public static RaycastInfo GenerateOriginalRaycast(Ray ray, float range, int mask, Player ignorePlayer = null)
        {
            RaycastHit hit;

            PhysicsUtility.raycast(ray, out hit, range, mask, QueryTriggerInteraction.UseGlobal);
            RaycastInfo raycastInfo = new RaycastInfo(hit)
            {
                direction = ray.direction
            };

            if (!(raycastInfo.transform == null))
            {
                if (!raycastInfo.transform.CompareTag("Barricade"))
                {
                    if (raycastInfo.transform.CompareTag("Structure"))
                    {
                        raycastInfo.transform = DamageTool.getStructureRootTransform(raycastInfo.transform);
                    }
                }
                else
                {
                    raycastInfo.transform = DamageTool.getBarricadeRootTransform(raycastInfo.transform);
                }
                if (raycastInfo.transform.CompareTag("Enemy"))
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                    if (raycastInfo.player == ignorePlayer)
                    {
                        raycastInfo.player = null;
                    }
                }
                if (raycastInfo.transform.CompareTag("Zombie"))
                {
                    raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
                }
                if (raycastInfo.transform.CompareTag("Animal"))
                {
                    raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
                }
                raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);
                if (!RaycastOptions.UseRandomLimb)
                {
                    if (RaycastOptions.UseCustomLimb)
                    {
                        raycastInfo.limb = RaycastOptions.TargetLimb;
                    }
                }
                else
                {
                    raycastInfo.limb = MathUtilities.RandomEnumValue <ELimb>();
                }
                if (raycastInfo.transform.CompareTag("Vehicle"))
                {
                    raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
                }
                if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
                {
                    raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
                }
                else
                {
                    raycastInfo.material = DamageTool.getMaterial(hit.point, raycastInfo.transform, raycastInfo.collider);
                }
                return(raycastInfo);
            }
            return(raycastInfo);
        }
        // Token: 0x06000094 RID: 148 RVA: 0x000068DC File Offset: 0x00004ADC
        public static RaycastInfo GenerateOriginalRaycast(Ray ray, float range, int mask)
        {
            RaycastHit hit;

            PhysicsUtility.raycast(ray, out hit, range, mask, QueryTriggerInteraction.UseGlobal);
            RaycastInfo raycastInfo = new RaycastInfo(hit);

            raycastInfo.direction = ray.direction;
            bool        flag = !(raycastInfo.transform == null);
            RaycastInfo result;

            if (flag)
            {
                bool flag2 = raycastInfo.transform.CompareTag("Barricade");
                if (flag2)
                {
                    raycastInfo.transform = DamageTool.getBarricadeRootTransform(raycastInfo.transform);
                }
                else
                {
                    bool flag3 = raycastInfo.transform.CompareTag("Structure");
                    if (flag3)
                    {
                        raycastInfo.transform = DamageTool.getStructureRootTransform(raycastInfo.transform);
                    }
                }
                bool flag4 = raycastInfo.transform.CompareTag("Enemy");
                if (flag4)
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                }
                bool flag5 = raycastInfo.transform.CompareTag("Zombie");
                if (flag5)
                {
                    raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
                }
                bool flag6 = raycastInfo.transform.CompareTag("Animal");
                if (flag6)
                {
                    raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
                }
                raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);
                bool flag7 = !RaycastOptions.UseRandomLimb;
                if (flag7)
                {
                    bool useCustomLimb = RaycastOptions.UseCustomLimb;
                    if (useCustomLimb)
                    {
                        raycastInfo.limb = RaycastOptions.TargetLimb;
                    }
                }
                else
                {
                    ELimb[] array = (ELimb[])Enum.GetValues(typeof(ELimb));
                    raycastInfo.limb = array[MathUtilities.Random.Next(0, array.Length)];
                }
                bool flag8 = raycastInfo.transform.CompareTag("Vehicle");
                if (flag8)
                {
                    raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
                }
                else
                {
                    bool flag9 = raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive;
                    if (flag9)
                    {
                        raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
                    }
                    else
                    {
                        raycastInfo.material = DamageTool.getMaterial(hit.point, raycastInfo.transform, raycastInfo.collider);
                    }
                }
                bool alwaysHitHead = RaycastOptions.AlwaysHitHead;
                if (alwaysHitHead)
                {
                    raycastInfo.limb = ELimb.SKULL;
                }
                result = raycastInfo;
            }
            else
            {
                result = raycastInfo;
            }
            return(result);
        }
        // Token: 0x060001F3 RID: 499 RVA: 0x00012908 File Offset: 0x00010B08
        public void OnGUI()
        {
            Player mainPlayer = OptimizationVariables.MainPlayer;
            bool   flag       = mainPlayer == null;
            object obj;

            if (flag)
            {
                obj = null;
            }
            else
            {
                PlayerEquipment equipment = mainPlayer.equipment;
                obj = ((equipment != null) ? equipment.useable : null);
            }
            UseableGun useableGun = obj as UseableGun;
            bool       flag2      = useableGun == null || TrajectoryComponent.spying || !WeaponOptions.EnableBulletDropPrediction || !Provider.modeConfigData.Gameplay.Ballistics;
            bool       flag3      = flag2;

            if (flag3)
            {
                bool flag4 = TrajectoryComponent.Highlighted != null;
                bool flag5 = flag4;
                if (flag5)
                {
                    TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted);
                    TrajectoryComponent.Highlighted = null;
                }
            }
            else
            {
                RaycastHit     raycastHit;
                List <Vector3> list   = TrajectoryComponent.PlotTrajectory(useableGun, out raycastHit, 255);
                bool           flag6  = Vector3.Distance(list.Last <Vector3>(), OptimizationVariables.MainPlayer.look.aim.position) > useableGun.equippedGunAsset.range;
                ColorVariable  color  = ColorUtilities.getColor("_TrajectoryPredictionInRange");
                ColorVariable  color2 = ColorUtilities.getColor("_TrajectoryPredictionOutOfRange");
                bool           flag7  = WeaponOptions.HighlightBulletDropPredictionTarget && raycastHit.collider != null;
                bool           flag8  = flag7;
                if (flag8)
                {
                    Transform  transform  = raycastHit.transform;
                    GameObject gameObject = null;
                    bool       flag9      = DamageTool.getPlayer(transform) != null;
                    bool       flag10     = flag9;
                    if (flag10)
                    {
                        gameObject = DamageTool.getPlayer(transform).gameObject;
                    }
                    else
                    {
                        bool flag11 = DamageTool.getZombie(transform) != null;
                        bool flag12 = flag11;
                        if (flag12)
                        {
                            gameObject = DamageTool.getZombie(transform).gameObject;
                        }
                        else
                        {
                            bool flag13 = DamageTool.getAnimal(transform) != null;
                            bool flag14 = flag13;
                            if (flag14)
                            {
                                gameObject = DamageTool.getAnimal(transform).gameObject;
                            }
                            else
                            {
                                bool flag15 = DamageTool.getVehicle(transform) != null;
                                bool flag16 = flag15;
                                if (flag16)
                                {
                                    gameObject = DamageTool.getVehicle(transform).gameObject;
                                }
                            }
                        }
                    }
                    bool flag17 = gameObject != null;
                    bool flag18 = flag17;
                    if (flag18)
                    {
                        Highlighter highlighter = gameObject.GetComponent <Highlighter>() ?? gameObject.AddComponent <Highlighter>();
                        bool        flag19      = !highlighter.enabled;
                        bool        flag20      = flag19;
                        if (flag20)
                        {
                            highlighter.occluder = true;
                            highlighter.overlay  = true;
                            highlighter.ConstantOnImmediate(flag6 ? color2 : color);
                        }
                        bool flag21 = TrajectoryComponent.Highlighted != null && highlighter != TrajectoryComponent.Highlighted;
                        bool flag22 = flag21;
                        if (flag22)
                        {
                            TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted);
                        }
                        TrajectoryComponent.Highlighted = highlighter;
                    }
                    else
                    {
                        bool flag23 = TrajectoryComponent.Highlighted != null;
                        bool flag24 = flag23;
                        if (flag24)
                        {
                            TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted);
                            TrajectoryComponent.Highlighted = null;
                        }
                    }
                }
                else
                {
                    bool flag25 = !WeaponOptions.HighlightBulletDropPredictionTarget && TrajectoryComponent.Highlighted != null;
                    bool flag26 = flag25;
                    if (flag26)
                    {
                        TrajectoryComponent.RemoveHighlight(TrajectoryComponent.Highlighted);
                        TrajectoryComponent.Highlighted = null;
                    }
                }
                ESPComponent.GLMat.SetPass(0);
                GL.PushMatrix();
                GL.LoadProjectionMatrix(OptimizationVariables.MainCam.projectionMatrix);
                GL.modelview = OptimizationVariables.MainCam.worldToCameraMatrix;
                GL.Begin(2);
                GL.Color(flag6 ? color2 : color);
                foreach (Vector3 v in list)
                {
                    GL.Vertex(v);
                }
                GL.End();
                GL.PopMatrix();
            }
        }
Exemplo n.º 19
0
        public static RaycastInfo raycast(Ray ray, float range, int mask)
        {
            int num;

            if (MP_Weapons.attackThroughWalls)
            {
                num = RayMasks.VEHICLE | RayMasks.ENEMY | RayMasks.ENTITY;
            }
            else
            {
                num = mask;
            }

            RaycastHit hit;

            Physics.Raycast(ray, out hit, range, num);
            RaycastInfo raycastInfo = new RaycastInfo(hit);

            raycastInfo.direction = ray.direction;
            if (hit.transform != null)
            {
                if (hit.transform.CompareTag("Enemy"))
                {
                    raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
                }
                if (hit.transform.CompareTag("Zombie"))
                {
                    raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
                }
                if (hit.transform.CompareTag("Animal"))
                {
                    raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
                }
                raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);
                if (hit.transform.CompareTag("Vehicle"))
                {
                    raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
                }
                if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
                {
                    raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
                }
                else
                {
                    raycastInfo.material = DamageTool.getMaterial(hit.point, hit.transform, hit.collider);
                }

                if (MP_Weapons.alwaysHitHead) // idk if it should interfere with silentaim so i just put it above silent aim :\
                {
                    raycastInfo.limb = ELimb.SKULL;
                }

                #region SilentAim
                if (MP_Aimbot.silentAim)
                {
                    Player p = ((SteamPlayer)MP_Aimbot.attackNext).player;

                    if (p == null || raycastInfo.zombie != null)
                    {
                        return(raycastInfo);
                    }

                    raycastInfo.player = p;
                    raycastInfo.limb   = MP_Aimbot.aimLocation;
                }
                #endregion
            }
            return(raycastInfo);
        }
Exemplo n.º 20
0
        public void OV_Update()
        {
            if (!DrawUtilities.ShouldRun())
            {
                return;
            }
            if (Player.player.stance.stance != EPlayerStance.DRIVING)
            {
                if (Player.player.stance.stance != EPlayerStance.SITTING)
                {
                    if (!Player.player.life.isDead && !Player.player.workzone.isBuilding)
                    {
                        if (Time.realtimeSinceStartup - OV_PlayerInteract.lastInteract > 0.1f)
                        {
                            int num = 0;
                            if (InteractionOptions.InteractThroughWalls && !PlayerCoroutines.IsSpying)
                            {
                                if (!InteractionOptions.NoHitBarricades)
                                {
                                    num |= RayMasks.BARRICADE;
                                }
                                if (!InteractionOptions.NoHitItems)
                                {
                                    num |= RayMasks.ITEM;
                                }
                                if (!InteractionOptions.NoHitResources)
                                {
                                    num |= RayMasks.RESOURCE;
                                }
                                if (!InteractionOptions.NoHitStructures)
                                {
                                    num |= RayMasks.STRUCTURE;
                                }
                                if (!InteractionOptions.NoHitVehicles)
                                {
                                    num |= RayMasks.VEHICLE;
                                }
                                if (!InteractionOptions.NoHitEnvironment)
                                {
                                    num |= (RayMasks.LARGE | RayMasks.MEDIUM | RayMasks.ENVIRONMENT | RayMasks.GROUND);
                                }
                            }
                            else
                            {
                                num = RayMasks.PLAYER_INTERACT;
                            }
                            OV_PlayerInteract.lastInteract = Time.realtimeSinceStartup;
                            float num2 = (!InteractionOptions.InteractThroughWalls || PlayerCoroutines.IsSpying) ? 4f : 20f;
                            PhysicsUtility.raycast(new Ray(OptimizationVariables.MainCam.transform.position, OptimizationVariables.MainCam.transform.forward), out OV_PlayerInteract.hit, (Player.player.look.perspective == EPlayerPerspective.THIRD) ? (num2 + 2f) : num2, num, QueryTriggerInteraction.UseGlobal);
                        }
                        Transform transform = (!(OV_PlayerInteract.hit.collider != null)) ? null : OV_PlayerInteract.hit.collider.transform;
                        if (!(transform != OV_PlayerInteract.focus))
                        {
                            goto IL_39E;
                        }
                        if (OV_PlayerInteract.focus != null && PlayerInteract.interactable != null)
                        {
                            InteractableDoorHinge componentInParent = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                            if (componentInParent != null)
                            {
                                HighlighterTool.unhighlight(componentInParent.door.transform);
                            }
                            else
                            {
                                HighlighterTool.unhighlight(PlayerInteract.interactable.transform);
                            }
                        }
                        OV_PlayerInteract.focus         = null;
                        OV_PlayerInteract.target        = null;
                        OV_PlayerInteract.interactable  = null;
                        OV_PlayerInteract.interactable2 = null;
                        if (!(transform != null))
                        {
                            goto IL_39E;
                        }
                        OV_PlayerInteract.focus         = transform;
                        OV_PlayerInteract.interactable  = OV_PlayerInteract.focus.GetComponentInParent <Interactable>();
                        OV_PlayerInteract.interactable2 = OV_PlayerInteract.focus.GetComponentInParent <Interactable2>();
                        if (!(PlayerInteract.interactable != null))
                        {
                            goto IL_39E;
                        }
                        OV_PlayerInteract.target = PlayerInteract.interactable.transform.FindChildRecursive("Target");
                        if (!PlayerInteract.interactable.checkInteractable())
                        {
                            OV_PlayerInteract.target       = null;
                            OV_PlayerInteract.interactable = null;
                            goto IL_39E;
                        }
                        if (!PlayerUI.window.isEnabled)
                        {
                            goto IL_39E;
                        }
                        if (!PlayerInteract.interactable.checkUseable())
                        {
                            Color color = Color.red;
                            InteractableDoorHinge componentInParent2 = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                            if (componentInParent2 != null)
                            {
                                HighlighterTool.highlight(componentInParent2.door.transform, color);
                                goto IL_39E;
                            }
                            HighlighterTool.highlight(PlayerInteract.interactable.transform, color);
                            goto IL_39E;
                        }
                        else
                        {
                            Color color;
                            if (!PlayerInteract.interactable.checkHighlight(out color))
                            {
                                color = Color.green;
                            }
                            InteractableDoorHinge componentInParent3 = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                            if (componentInParent3 != null)
                            {
                                HighlighterTool.highlight(componentInParent3.door.transform, color);
                                goto IL_39E;
                            }
                            HighlighterTool.highlight(PlayerInteract.interactable.transform, color);
                            goto IL_39E;
                        }
                    }
                }
            }
            if (OV_PlayerInteract.focus != null && PlayerInteract.interactable != null)
            {
                InteractableDoorHinge componentInParent4 = OV_PlayerInteract.focus.GetComponentInParent <InteractableDoorHinge>();
                if (componentInParent4 != null)
                {
                    HighlighterTool.unhighlight(componentInParent4.door.transform);
                }
                else
                {
                    HighlighterTool.unhighlight(PlayerInteract.interactable.transform);
                }
            }
            OV_PlayerInteract.focus         = null;
            OV_PlayerInteract.target        = null;
            OV_PlayerInteract.interactable  = null;
            OV_PlayerInteract.interactable2 = null;
IL_39E:
            if (!Player.player.life.isDead)
            {
                EPlayerMessage message;
                string         text;
                Color          color2;
                if (!(PlayerInteract.interactable != null))
                {
                    if (OV_PlayerInteract.purchaseAsset != null && Player.player.movement.purchaseNode != null && !PlayerUI.window.showCursor)
                    {
                        PlayerUI.hint(null, EPlayerMessage.PURCHASE, string.Empty, Color.white, new object[]
                        {
                            OV_PlayerInteract.purchaseAsset.itemName,
                            Player.player.movement.purchaseNode.cost
                        });
                    }
                    else if (OV_PlayerInteract.focus != null && OV_PlayerInteract.focus.CompareTag("Enemy"))
                    {
                        Player player = DamageTool.getPlayer(OV_PlayerInteract.focus);
                        if (player != null && player != Player.player && !PlayerUI.window.showCursor)
                        {
                            PlayerUI.hint(null, EPlayerMessage.ENEMY, string.Empty, Color.white, new object[]
                            {
                                player.channel.owner
                            });
                        }
                    }
                }
                else if (PlayerInteract.interactable.checkHint(out message, out text, out color2) && !PlayerUI.window.showCursor)
                {
                    if (!PlayerInteract.interactable.CompareTag("Item"))
                    {
                        PlayerUI.hint((!(OV_PlayerInteract.target != null)) ? OV_PlayerInteract.focus : OV_PlayerInteract.target, message, text, color2, Array.Empty <object>());
                    }
                    else
                    {
                        PlayerUI.hint((!(OV_PlayerInteract.target != null)) ? OV_PlayerInteract.focus : OV_PlayerInteract.target, message, text, color2, new object[]
                        {
                            ((InteractableItem)PlayerInteract.interactable).item,
                            ((InteractableItem)PlayerInteract.interactable).asset
                        });
                    }
                }
                EPlayerMessage message2;
                float          data;
                if (PlayerInteract.interactable2 != null && PlayerInteract.interactable2.checkHint(out message2, out data) && !PlayerUI.window.showCursor)
                {
                    PlayerUI.hint2(message2, (!OV_PlayerInteract.isHoldingKey) ? 0f : ((Time.realtimeSinceStartup - OV_PlayerInteract.lastKeyDown) / this.salvageTime), data);
                }
                if ((Player.player.stance.stance == EPlayerStance.DRIVING || Player.player.stance.stance == EPlayerStance.SITTING) && !Input.GetKey(KeyCode.LeftShift))
                {
                    if (Input.GetKeyDown(KeyCode.F1))
                    {
                        this.hotkey(0);
                    }
                    if (Input.GetKeyDown(KeyCode.F2))
                    {
                        this.hotkey(1);
                    }
                    if (Input.GetKeyDown(KeyCode.F3))
                    {
                        this.hotkey(2);
                    }
                    if (Input.GetKeyDown(KeyCode.F4))
                    {
                        this.hotkey(3);
                    }
                    if (Input.GetKeyDown(KeyCode.F5))
                    {
                        this.hotkey(4);
                    }
                    if (Input.GetKeyDown(KeyCode.F6))
                    {
                        this.hotkey(5);
                    }
                    if (Input.GetKeyDown(KeyCode.F7))
                    {
                        this.hotkey(6);
                    }
                    if (Input.GetKeyDown(KeyCode.F8))
                    {
                        this.hotkey(7);
                    }
                    if (Input.GetKeyDown(KeyCode.F9))
                    {
                        this.hotkey(8);
                    }
                    if (Input.GetKeyDown(KeyCode.F10))
                    {
                        this.hotkey(9);
                    }
                }
                if (Input.GetKeyDown(ControlsSettings.interact))
                {
                    OV_PlayerInteract.lastKeyDown  = Time.realtimeSinceStartup;
                    OV_PlayerInteract.isHoldingKey = true;
                }
                if (Input.GetKeyDown(ControlsSettings.inspect))
                {
                    if (ControlsSettings.inspect != ControlsSettings.interact)
                    {
                        if (Player.player.equipment.canInspect)
                        {
                            Player.player.channel.send("askInspect", ESteamCall.SERVER, ESteamPacket.UPDATE_UNRELIABLE_BUFFER, Array.Empty <object>());
                        }
                    }
                }
                if (OV_PlayerInteract.isHoldingKey)
                {
                    if (!Input.GetKeyUp(ControlsSettings.interact))
                    {
                        if (Time.realtimeSinceStartup - OV_PlayerInteract.lastKeyDown > this.salvageTime)
                        {
                            OV_PlayerInteract.isHoldingKey = false;
                            if (!PlayerUI.window.showCursor && PlayerInteract.interactable2 != null)
                            {
                                PlayerInteract.interactable2.use();
                            }
                        }
                    }
                    else
                    {
                        OV_PlayerInteract.isHoldingKey = false;
                        if (!PlayerUI.window.showCursor)
                        {
                            if (Player.player.stance.stance != EPlayerStance.DRIVING)
                            {
                                if (Player.player.stance.stance != EPlayerStance.SITTING)
                                {
                                    if (OV_PlayerInteract.focus != null && PlayerInteract.interactable != null)
                                    {
                                        if (PlayerInteract.interactable.checkUseable())
                                        {
                                            PlayerInteract.interactable.use();
                                            return;
                                        }
                                        return;
                                    }
                                    else if (OV_PlayerInteract.purchaseAsset == null)
                                    {
                                        if (ControlsSettings.inspect != ControlsSettings.interact)
                                        {
                                            return;
                                        }
                                        if (Player.player.equipment.canInspect)
                                        {
                                            Player.player.channel.send("askInspect", ESteamCall.SERVER, ESteamPacket.UPDATE_UNRELIABLE_BUFFER, Array.Empty <object>());
                                            return;
                                        }
                                        return;
                                    }
                                    else
                                    {
                                        if (Player.player.skills.experience >= Player.player.movement.purchaseNode.cost)
                                        {
                                            Player.player.skills.sendPurchase(Player.player.movement.purchaseNode);
                                            return;
                                        }
                                        return;
                                    }
                                }
                            }
                            VehicleManager.exitVehicle();
                            return;
                        }
                        if (Player.player.inventory.isStoring && Player.player.inventory.shouldInteractCloseStorage)
                        {
                            PlayerDashboardUI.close();
                            PlayerLifeUI.open();
                            return;
                        }
                        if (PlayerBarricadeSignUI.active)
                        {
                            PlayerBarricadeSignUI.close();
                            PlayerLifeUI.open();
                            return;
                        }
                        if (PlayerBarricadeStereoUI.active)
                        {
                            PlayerBarricadeStereoUI.close();
                            PlayerLifeUI.open();
                            return;
                        }
                        if (PlayerBarricadeLibraryUI.active)
                        {
                            PlayerBarricadeLibraryUI.close();
                            PlayerLifeUI.open();
                            return;
                        }
                        if (PlayerBarricadeMannequinUI.active)
                        {
                            PlayerBarricadeMannequinUI.close();
                            PlayerLifeUI.open();
                            return;
                        }
                        if (PlayerNPCDialogueUI.active)
                        {
                            if (PlayerNPCDialogueUI.dialogueAnimating)
                            {
                                PlayerNPCDialogueUI.skipText();
                                return;
                            }
                            if (PlayerNPCDialogueUI.dialogueHasNextPage)
                            {
                                PlayerNPCDialogueUI.nextPage();
                                return;
                            }
                            PlayerNPCDialogueUI.close();
                            PlayerLifeUI.open();
                            return;
                        }
                        else
                        {
                            if (PlayerNPCQuestUI.active)
                            {
                                PlayerNPCQuestUI.closeNicely();
                                return;
                            }
                            if (PlayerNPCVendorUI.active)
                            {
                                PlayerNPCVendorUI.closeNicely();
                                return;
                            }
                        }
                    }
                }
                return;
            }
        }
Exemplo n.º 21
0
        public static RaycastInfo GenerateOriginalRaycast(Ray ray, float range, int mask)
        {
            PhysicsUtility.raycast(ray, out RaycastHit hit, range, mask, QueryTriggerInteraction.UseGlobal);
            RaycastInfo raycastInfo = new RaycastInfo(hit)
            {
                direction = ray.direction
            };

            if (hit.transform == null)
            {
                return(raycastInfo);
            }

            if (raycastInfo.transform.CompareTag("Barricade"))
            {
                raycastInfo.transform = DamageTool.getBarricadeRootTransform(raycastInfo.transform);
            }

            else if (raycastInfo.transform.CompareTag("Structure"))
            {
                raycastInfo.transform = DamageTool.getStructureRootTransform(raycastInfo.transform);
            }

            if (raycastInfo.transform.CompareTag("Enemy"))
            {
                raycastInfo.player = DamageTool.getPlayer(raycastInfo.transform);
            }

            if (raycastInfo.transform.CompareTag("Zombie"))
            {
                raycastInfo.zombie = DamageTool.getZombie(raycastInfo.transform);
            }

            if (raycastInfo.transform.CompareTag("Animal"))
            {
                raycastInfo.animal = DamageTool.getAnimal(raycastInfo.transform);
            }

            raycastInfo.limb = DamageTool.getLimb(raycastInfo.transform);

            if (RaycastOptions.UseCustomLimb)
            {
                raycastInfo.limb = RaycastOptions.TargetLimb;
            }

            else if (RaycastOptions.UseRandomLimb)
            {
                ELimb[] Limbs = (ELimb[])Enum.GetValues(typeof(ELimb));
                raycastInfo.limb = Limbs[MathUtilities.Random.Next(0, Limbs.Length)];
            }

            if (raycastInfo.transform.CompareTag("Vehicle"))
            {
                raycastInfo.vehicle = DamageTool.getVehicle(raycastInfo.transform);
            }

            if (raycastInfo.zombie != null && raycastInfo.zombie.isRadioactive)
            {
                raycastInfo.material = EPhysicsMaterial.ALIEN_DYNAMIC;
            }
            else
            {
                raycastInfo.material = DamageTool.getMaterial(hit.point, raycastInfo.transform, raycastInfo.collider);
            }

            return(raycastInfo);
        }
Exemplo n.º 22
0
        private void udESP()
        {
            while (!terminate)
            {
                try
                {
                    if (espEnabled)
                    {
                        if (dManager.d_ref)
                        {
                            dManager.drawing_esp.Clear();
                            Collider[] cols = Physics.OverlapSphere(Information.player.transform.position, distance, RayMasks.DAMAGE_CLIENT);
                            foreach (Collider c in cols)
                            {
                                if (DamageTool.getPlayer(c.transform) != null)
                                {
                                    SDG.Unturned.Player ut = DamageTool.getPlayer(c.transform);
                                    if (esp_player)
                                    {
                                        if (ut.gameObject == null)
                                        {
                                            continue;
                                        }
                                        SteamPlayer ply      = Tool.getSteamPlayer(ut.gameObject);
                                        bool        isFriend = ComponentManager.friend_manager.exists(ply.playerID.steamID.m_SteamID);
                                        float       dist     = (float)Math.Round(Tool.getDistance(ut.transform.position));
                                        Vector3     c2s      = MainCamera.instance.WorldToScreenPoint(ut.transform.position);
                                        Highlighter h        = ut.gameObject.GetComponent <Highlighter>();

                                        if (c2s.z <= 0)
                                        {
                                            continue;
                                        }

                                        c2s.x = c2s.x - 64f;
                                        c2s.y = (Screen.height - (c2s.y + 1f)) - 12f;

                                        if (Array.Exists(dManager.drawing_esp.ToArray(), a => a.pos == c2s))
                                        {
                                            continue;
                                        }

                                        dManager.drawing_esp.Add(new DrawType((p_name ? ply.playerID.nickName : "") + (p_distance ? "[" + dist + "]" : ""), c2s, (isFriend ? Information.esp_friends : Information.esp_players), p_name || p_distance, ut.gameObject, Tool.BoundsToScreenRect(c.bounds)));


                                        if (draw_highlight)
                                        {
                                            if (h == null)
                                            {
                                                h = ut.gameObject.AddComponent <Highlighter>();
                                                h.OccluderOn();
                                                h.SeeThroughOn();
                                                h.ConstantOn((isFriend ? Information.esp_friends : Information.esp_players));
                                            }
                                            HighlightType ht = dManager.highlights.Find(a => a.h == h);
                                            if (ht == null)
                                            {
                                                dManager.highlights.Add(new HighlightType(h, ut.gameObject));
                                            }
                                            else
                                            {
                                                ht.hasUd = true;
                                            }
                                        }
                                        continue;
                                    }
                                }

                                if (DamageTool.getZombie(c.transform))
                                {
                                    SDG.Unturned.Zombie ut = DamageTool.getZombie(c.transform);
                                    if (esp_zombie)
                                    {
                                        if (ut.gameObject == null && !ut.isDead)
                                        {
                                            continue;
                                        }
                                        float       dist = (float)Math.Round(Tool.getDistance(ut.transform.position));
                                        Vector3     c2s  = Camera.main.WorldToScreenPoint(ut.transform.position);
                                        Highlighter h    = ut.gameObject.GetComponent <Highlighter>();

                                        if (c2s.z <= 0)
                                        {
                                            continue;
                                        }

                                        c2s.x = c2s.x - 64f;
                                        c2s.y = (Screen.height - (c2s.y + 1f)) - 12f;

                                        if (Array.Exists(dManager.drawing_esp.ToArray(), a => a.pos == c2s))
                                        {
                                            continue;
                                        }

                                        dManager.drawing_esp.Add(new DrawType((z_name ? getZombieName(ut) : "") + (z_distance ? "[" + dist + "]" : ""), c2s, Information.esp_zombies, z_name || z_distance, ut.gameObject, Tool.BoundsToScreenRect(c.bounds)));

                                        if (draw_highlight)
                                        {
                                            if (h == null)
                                            {
                                                h = ut.gameObject.AddComponent <Highlighter>();
                                                h.OccluderOn();
                                                h.SeeThroughOn();
                                                h.ConstantOn(Information.esp_zombies);
                                            }
                                            HighlightType ht = dManager.highlights.Find(a => a.h == h);
                                            if (ht == null)
                                            {
                                                dManager.highlights.Add(new HighlightType(h, ut.gameObject));
                                            }
                                            else
                                            {
                                                ht.hasUd = true;
                                            }
                                        }
                                        continue;
                                    }
                                }
                            }
                            dManager.d_ref = false;
                        }
                    }
                    else
                    {
                        dManager.rm_highlights = true;
                        dManager.drawing_esp.Clear();
                    }
                }
                catch (Exception ex)
                {
                    Debug.LogException(ex);
                }
            }
        }