Example #1
0
 // Token: 0x06000D0B RID: 3339 RVA: 0x0005D11C File Offset: 0x0005B31C
 public bool Interact(Humanoid user, bool hold)
 {
     if (hold)
     {
         return(false);
     }
     if (!PrivateArea.CheckAccess(base.transform.position, 0f, true, false))
     {
         return(true);
     }
     Fermenter.Status status = this.GetStatus();
     if (status == Fermenter.Status.Empty)
     {
         ItemDrop.ItemData itemData = this.FindCookableItem(user.GetInventory());
         if (itemData == null)
         {
             user.Message(MessageHud.MessageType.Center, "$msg_noprocessableitems", 0, null);
             return(true);
         }
         this.AddItem(user, itemData);
     }
     else if (status == Fermenter.Status.Ready)
     {
         this.m_nview.InvokeRPC("Tap", Array.Empty <object>());
     }
     return(true);
 }
Example #2
0
    // Token: 0x060002F7 RID: 759 RVA: 0x000195B8 File Offset: 0x000177B8
    private void SpawnOnHitTerrain(Vector3 hitPoint, GameObject prefab)
    {
        TerrainModifier componentInChildren = prefab.GetComponentInChildren <TerrainModifier>();

        if (componentInChildren)
        {
            if (!PrivateArea.CheckAccess(hitPoint, componentInChildren.GetRadius(), true, false))
            {
                return;
            }
            if (Location.IsInsideNoBuildLocation(hitPoint))
            {
                return;
            }
        }
        TerrainModifier.SetTriggerOnPlaced(true);
        GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(prefab, hitPoint, Quaternion.LookRotation(this.m_character.transform.forward));

        TerrainModifier.SetTriggerOnPlaced(false);
        IProjectile component = gameObject.GetComponent <IProjectile>();

        if (component != null)
        {
            component.Setup(this.m_character, Vector3.zero, this.m_attackHitNoise, null, this.m_weapon);
        }
    }
Example #3
0
        private static void RemoveForceFieldForPrivateArea(PrivateArea pa)
        {
            Plugin.Log("RemoveForceFieldForPrivateArea called");
            List <SphereCollider> forceFields = GetForceFieldsInRange(pa.transform.position, 2);

            foreach (SphereCollider forceField in forceFields)
            {
                EffectArea noMonstersArea = forceField.GetComponent <EffectArea>();

                if (null != noMonstersArea)
                {
                    // destroy the colliders
                    SphereCollider[] colliders = noMonstersArea.GetComponents <SphereCollider>();
                    for (int i = 0; i < colliders.Length; i++)
                    {
                        Plugin.Log("RemoveForceFieldForPrivateArea - Destroying SphereCollider");
                        GameObject.Destroy(colliders[i]);
                    }

                    // destroy the object
                    Plugin.Log("RemoveForceFieldForPrivateArea - Destroying EffectArea");
                    GameObject.Destroy(noMonstersArea);
                }
                Plugin.Log("RemoveForceFieldForPrivateArea - Destroying forceField");
                GameObject.Destroy(forceField);
            }
        }
Example #4
0
        internal static void SetName(ref Tameable instance, string name, bool save)
        {
            if (!instance)
            {
                return;
            }

            if (instance.m_character)
            {
                instance.m_character.m_name = name;
            }

            if (instance.transform && instance.transform.GetComponent <Text>())
            {
                instance.transform.GetComponent <Text>().text = name;
            }
            if (save)
            {
                if (!PrivateArea.CheckAccess(instance.transform.position, 0f, false))
                {
                    Debug.LogWarning("Cannot set name on ZDO, you do not have access.");
                    return;
                }
                instance.m_nview.ClaimOwnership();
                instance.m_nview.GetZDO().Set(Tameable_Patch.TameableNameZDOKey, name);
            }
        }
        public void UpdateCopiedPrefab(GameObject Prefab)
        {
            this.Prefab = Prefab;

            Piece piece = Prefab.GetComponent <Piece>();

            piece.m_name        = "$piece_seed_totem_name";
            piece.m_description = "$piece_seed_totem_description";
            piece.m_clipGround  = true;
            piece.m_groundPiece = true;
            piece.m_groundOnly  = true;
            piece.m_noInWater   = true;
            foreach (GuidePoint guidePoint in Prefab.GetComponentsInChildren <GuidePoint>())
            {
                guidePoint.m_text.m_key   = localizationName;
                guidePoint.m_text.m_topic = ravenTopic;
                guidePoint.m_text.m_text  = ravenText;
                guidePoint.m_text.m_label = ravenLabel;
            }

            prefabSeedTotem = Prefab.AddComponent <SeedTotem>();
            PrivateArea privateArea = Prefab.GetComponent <PrivateArea>();

            if (privateArea != null)
            {
                logger.LogDebug("Converting PrivateArea to SeedTotem");
                SeedTotem.CopyPrivateArea(prefabSeedTotem, privateArea);
                logger.LogDebug("Destroying redundant PrivateArea: " + privateArea);
                Object.DestroyImmediate(privateArea);
            }

            RegisterPiece();
        }
Example #6
0
        private static bool Prefix(Beehive __instance, ref string __result)
        {
            if (!Configuration.Current.Beehive.IsEnabled || !Configuration.Current.Beehive.showDuration)
            {
                return(true);
            }

            if (!PrivateArea.CheckAccess(__instance.transform.position, 0f, false))
            {
                __result = Localization.instance.Localize(__instance.m_name + "\n$piece_noaccess");
                return(false);
            }
            int honeyLevel = __instance.GetHoneyLevel();

            if (honeyLevel > 0)
            {
                __result = Localization.instance.Localize(string.Concat(new object[]
                {
                    __instance.m_name,
                    " ( ",
                    __instance.m_honeyItem.m_itemData.m_shared.m_name,
                    " x ",
                    honeyLevel,
                    " ) " + calculateTimeLeft(__instance) + "\n[<color=yellow><b>$KEY_Use</b></color>] $piece_beehive_extract"
                }));
                return(false);
            }
            __result = Localization.instance.Localize(__instance.m_name + " ( $piece_container_empty ) " + calculateTimeLeft(__instance) + "\n[<color=yellow><b>$KEY_Use</b></color>] $piece_beehive_check");
            return(false);
        }
Example #7
0
 // Token: 0x06000C72 RID: 3186 RVA: 0x00059310 File Offset: 0x00057510
 public bool Interact(Humanoid character, bool repeat)
 {
     if (repeat)
     {
         return(false);
     }
     if (!PrivateArea.CheckAccess(base.transform.position, 0f, true, false))
     {
         return(true);
     }
     if (this.GetHoneyLevel() > 0)
     {
         this.Extract();
     }
     else
     {
         if (!this.CheckBiome())
         {
             character.Message(MessageHud.MessageType.Center, "$piece_beehive_area", 0, null);
             return(true);
         }
         if (!this.HaveFreeSpace())
         {
             character.Message(MessageHud.MessageType.Center, "$piece_beehive_freespace", 0, null);
             return(true);
         }
         if (!EnvMan.instance.IsDaylight())
         {
             character.Message(MessageHud.MessageType.Center, "$piece_beehive_sleep", 0, null);
             return(true);
         }
         character.Message(MessageHud.MessageType.Center, "$piece_beehive_happy", 0, null);
     }
     return(true);
 }
            private static bool Prefix(InventoryGui __instance)
            {
                if (WorldofValheimZones.ServerMode)
                {
                    return(true);
                }
                bool isInArea = false;

                // Ward Check
                if (Client.Ward.Drop && PrivateArea.CheckInPrivateArea(Player.m_localPlayer.transform.position, false))
                {
                    if (!PrivateArea.CheckAccess(Player.m_localPlayer.transform.position, 0f, true, false))
                    {
                        bool test     = PrivateArea.CheckAccess(Player.m_localPlayer.transform.position);
                        long PlayerID = Player.m_localPlayer.GetPlayerID();
                        Util.DoAreaEffectW(Player.m_localPlayer.transform.position);
                        MessageHud.instance.ShowMessage(MessageHud.MessageType.TopLeft, "This is a Warded Area", 0, null);
                        isInArea = true;
                        return(!isInArea);
                    }
                }
                if (Util.RestrictionCheck("noitemdrop"))
                {
                    isInArea = true;
                    Util.DoAreaEffect(Player.m_localPlayer.transform.position + Vector3.up * 0.5f);
                    MessageHud.instance.ShowMessage(MessageHud.MessageType.TopLeft, "This is a Private Area", 0, null);
                }
                return(!isInArea);
            }
        // Check for access to object
        private static Boolean isValidRayCastTarget()
        {
            Boolean hitValid = true;

            if (HitPiece.m_onlyInTeleportArea && !EffectArea.IsPointInsideArea(HitPiece.transform.position, EffectArea.Type.Teleport, 0f))
            {
                // Not in Teleport Area
                hitValid = false;
            }
            if (!HitPiece.m_allowedInDungeons && (HitPiece.transform.position.y > 3000f))
            {
                // Not in dungeon
                hitValid = false;
            }
            if (Location.IsInsideNoBuildLocation(HitPiece.transform.position))
            {
                // No build zone
                hitValid = false;
            }
            float radius = HitPiece.GetComponent <PrivateArea>() ? HitPiece.GetComponent <PrivateArea>().m_radius : 0f;

            if (!PrivateArea.CheckAccess(HitPiece.transform.position, radius, true))
            {
                // private zone
                hitValid = false;
            }

            return(hitValid);
        }
        private static Boolean isValidPlacement()
        {
            bool water = component.m_waterPiece || component.m_noInWater;

            PlayerInstance.m_placementStatus = 0;

            if (component.m_groundOnly || component.m_groundPiece || component.m_cultivatedGroundOnly)
            {
                PlayerInstance.m_placementMarkerInstance.SetActive(false);
            }

            StationExtension component2 = component.GetComponent <StationExtension>();

            if (component2 != null)
            {
                CraftingStation craftingStation = component2.FindClosestStationInRange(component.transform.position);
                if (craftingStation)
                {
                    component2.StartConnectionEffect(craftingStation);
                }
                else
                {
                    component2.StopConnectionEffect();
                    PlayerInstance.m_placementStatus = Player.PlacementStatus.ExtensionMissingStation; // Missing Station
                }
                if (component2.OtherExtensionInRange(component.m_spaceRequirement))
                {
                    PlayerInstance.m_placementStatus = Player.PlacementStatus.MoreSpace; // More Space
                }
            }

            if (component.m_onlyInTeleportArea && !EffectArea.IsPointInsideArea(component.transform.position, EffectArea.Type.Teleport, 0f))
            {
                PlayerInstance.m_placementStatus = Player.PlacementStatus.NoTeleportArea;
            }
            if (!component.m_allowedInDungeons && (component.transform.position.y > 3000f))
            {
                PlayerInstance.m_placementStatus = Player.PlacementStatus.NotInDungeon;
            }
            if (Location.IsInsideNoBuildLocation(PlayerInstance.m_placementGhost.transform.position))
            {
                PlayerInstance.m_placementStatus = Player.PlacementStatus.NoBuildZone;
            }
            float radius = component.GetComponent <PrivateArea>() ? component.GetComponent <PrivateArea>().m_radius : 0f;

            if (!PrivateArea.CheckAccess(PlayerInstance.m_placementGhost.transform.position, radius, true))
            {
                PlayerInstance.m_placementStatus = Player.PlacementStatus.PrivateZone;
            }

            if (PlayerInstance.m_placementStatus != 0)
            {
                component.SetInvalidPlacementHeightlight(true);
            }
            else
            {
                component.SetInvalidPlacementHeightlight(false);
            }
            return(true);
        }
Example #11
0
    // Token: 0x06000D0A RID: 3338 RVA: 0x0005D01C File Offset: 0x0005B21C
    public string GetHoverText()
    {
        if (!PrivateArea.CheckAccess(base.transform.position, 0f, false, false))
        {
            return(Localization.instance.Localize(this.m_name + "\n$piece_noaccess"));
        }
        switch (this.GetStatus())
        {
        case Fermenter.Status.Empty:
            return(Localization.instance.Localize(this.m_name + " ( $piece_container_empty )\n[<color=yellow><b>$KEY_Use</b></color>] $piece_fermenter_add"));

        case Fermenter.Status.Fermenting:
        {
            string contentName = this.GetContentName();
            if (this.m_exposed)
            {
                return(Localization.instance.Localize(this.m_name + " ( " + contentName + ", $piece_fermenter_exposed )"));
            }
            return(Localization.instance.Localize(this.m_name + " ( " + contentName + ", $piece_fermenter_fermenting )"));
        }

        case Fermenter.Status.Ready:
        {
            string contentName2 = this.GetContentName();
            return(Localization.instance.Localize(this.m_name + " ( " + contentName2 + ", $piece_fermenter_ready )\n[<color=yellow><b>$KEY_Use</b></color>] $piece_fermenter_tap"));
        }
        }
        return(this.m_name);
    }
Example #12
0
 private static void Prefix(ref PrivateArea __instance)
 {
     if (Configuration.Current.Ward.IsEnabled && Configuration.Current.Ward.wardRange > 0)
     {
         __instance.m_radius = Configuration.Current.Ward.wardRange;
     }
 }
Example #13
0
        static bool Tameable_Interact(ref Tameable __instance, Humanoid user, bool hold)
        {
            bool validKey = Enum.TryParse(Settings.RenameModifierKey.Value, out KeyCode key);

            if (!validKey || !Input.GetKey(key))
            {
                return(true);
            }

            if (!PrivateArea.CheckAccess(__instance.transform.position, 0f, false, true))
            {
                Debug.LogWarning("You don't have permission to edit this animal's name.");
                return(true);
            }
            if (!__instance.m_character.IsTamed())
            {
                Debug.LogWarning("Cannot name an animal before they are tame.");
                return(true);
            }

            TameableTextReciever textReciever = new TameableTextReciever(ref __instance, __instance.m_character.m_name);

            TextInput.instance.RequestText(textReciever, TameableTextInputTopic, TameableMaxNameLength);

            return(false);
        }
Example #14
0
        /// <summary>
        ///     CLIENT SIDE: Creates a <see cref="PortalSelectionGUI" /> when interacting with a portal
        /// </summary>
        private static bool ShowPortalSelection(On.TeleportWorld.orig_Interact orig, TeleportWorld self, Humanoid human, bool hold)
        {
            bool result = orig(self, human, hold);

            // only act on clients
            if (ZNet.instance.IsServerInstance())
            {
                return(result);
            }

            // must be enabled
            if (!ConfigUtil.Get <bool>("Map", "showPortalSelection"))
            {
                return(result);
            }

            // i like my personal space
            if (!PrivateArea.CheckAccess(self.transform.position) || hold)
            {
                return(result);
            }

            PortalSelectionGUI.OpenPortalSelection();

            return(result);
        }
Example #15
0
 // Token: 0x06000F14 RID: 3860 RVA: 0x0006BD64 File Offset: 0x00069F64
 public string GetHoverText()
 {
     if (!PrivateArea.CheckAccess(base.transform.position, 0f, false, false))
     {
         return("\"" + this.GetText() + "\"");
     }
     return("\"" + this.GetText() + "\"\n" + Localization.instance.Localize(this.m_name + "\n[<color=yellow><b>$KEY_Use</b></color>] $piece_use"));
 }
Example #16
0
            // Prefix indicates that your code will execute before the actual code
            private static void Prefix(PrivateArea __instance)
            {
                Plugin.Log($"GuardStone/PrivateArea Radius: {__instance.m_radius}");
                __instance.m_radius = Settings.GuardStoneRadius.Value;
                FixupRadii(__instance, Settings.GuardStoneRadius.Value);

                Plugin.Log($"Modified GuardStone/PrivateArea Radius: {__instance.m_radius}");
            }
Example #17
0
        private static bool Prefix(ref Fermenter __instance, ref string __result)
        {
            if (!Configuration.Current.Fermenter.IsEnabled || !Configuration.Current.Fermenter.showFermenterDuration)
            {
                return(true);
            }

            if (!PrivateArea.CheckAccess(__instance.transform.position, 0f, false))
            {
                __result = Localization.instance.Localize(__instance.m_name + "\n$piece_noaccess");
                return(false);
            }
            switch (__instance.GetStatus())
            {
            case Fermenter.Status.Empty:
                __result = Localization.instance.Localize(__instance.m_name + " ( $piece_container_empty )\n[<color=yellow><b>$KEY_Use</b></color>] $piece_fermenter_add");
                return(false);

            case Fermenter.Status.Fermenting:
            {
                string contentName = __instance.GetContentName();

                if (__instance.m_exposed)
                {
                    __result = Localization.instance.Localize(__instance.m_name + " ( " + contentName + ", $piece_fermenter_exposed )");
                    return(false);
                }

                double durationUntilDone = (double)__instance.m_fermentationDuration - __instance.GetFermentationTime();

                string info = "";

                int minutes = (int)durationUntilDone / 60;

                if (((int)durationUntilDone) >= 120)
                {
                    info = minutes + " minutes";
                }
                else
                {
                    info = (int)durationUntilDone + " seconds";
                }

                __result = Localization.instance.Localize(__instance.m_name + " ( " + contentName + ", $piece_fermenter_fermenting )") + " (" + info + ")";
                return(false);
            }

            case Fermenter.Status.Ready:
            {
                string contentName2 = __instance.GetContentName();
                __result = Localization.instance.Localize(__instance.m_name + " ( " + contentName2 + ", $piece_fermenter_ready )\n[<color=yellow><b>$KEY_Use</b></color>] $piece_fermenter_tap");
                return(false);
            }
            }
            __result = __instance.m_name;

            return(false);
        }
Example #18
0
        public void SetText(string text)
        {
            if (!PrivateArea.CheckAccess(transform.position, 0f, true))
            {
                return;
            }

            StartCoroutine(DownloadTexture(text, ApplyTexture));
        }
Example #19
0
 static void Prefix(long sender, ref float v)
 {
     if (configEnableStaminaDrainReduction.Value)
     {
         if (PrivateArea.CheckInPrivateArea(Player.m_localPlayer.transform.position))
         {
             v -= v * configStaminaDrainReductionPercent.Value / 100;
         }
     }
 }
Example #20
0
 // Token: 0x06000F1A RID: 3866 RVA: 0x0006BE64 File Offset: 0x0006A064
 public void SetText(string text)
 {
     if (!PrivateArea.CheckAccess(base.transform.position, 0f, true, false))
     {
         return;
     }
     this.m_nview.ClaimOwnership();
     this.m_textWidget.text = text;
     this.m_nview.GetZDO().Set("text", text);
 }
Example #21
0
 static bool Prefix(TreeLog __instance, ref HitData hit, ZNetView ___m_nview)
 {
     if (___m_nview != null)
     {
         if (PrivateArea.CheckInPrivateArea(__instance.transform.position))
         {
             ApplyDamageReduction(ref hit, configFloraDamageReduction.Value);
         }
     }
     return(true);
 }
Example #22
0
 public static float getFoodDrainMod()
 {
     if (configEnableFoodDrainReduction.Value)
     {
         if (PrivateArea.CheckInPrivateArea(Player.m_localPlayer.transform.position))
         {
             return(1 - configFoodDrainReductionPercent.Value / 100);
         }
     }
     return(1f);
 }
Example #23
0
            private static void Prefix(ref PrivateArea __instance)
            {
                if (Configuration.Current.Ward.IsEnabled && Configuration.Current.Ward.wardRange > 0)
                {
                    __instance.m_radius = Configuration.Current.Ward.wardRange;

                    // Apply this change to the child GameObject's EffectArea collision.
                    // Various other systems query this collision instead of the PrivateArea radius for permissions (notably, enemy spawning).
                    Helper.ResizeChildEffectArea(__instance, EffectArea.Type.PlayerBase, Configuration.Current.Ward.wardEnemySpawnRange > 0 ? Configuration.Current.Ward.wardEnemySpawnRange : Configuration.Current.Ward.wardRange);
                }
            }
Example #24
0
 public static bool Damage(WearNTear __instance, ref HitData hit)
 {
     if (AccessTools.FieldRefAccess <WearNTear, ZNetView>(__instance, "m_nview").IsValid())
     {
         var Ply = Player.m_localPlayer;
         if (Ply != null && PrivateArea.CheckInPrivateArea(hit.m_point, true))
         {
             return(SmartBepInMods.Tools.Patching.Constants.CONST.SKIP);
         }
     }
     return(SmartBepInMods.Tools.Patching.Constants.CONST.NOSKIP);
 }
Example #25
0
 private static void FixupRadii(PrivateArea pa, float radius)
 {
     Plugin.Log($"FixupRaddi called - {radius}");
     foreach (SphereCollider sphere in pa.GetComponents <SphereCollider>())
     {
         Plugin.Log("sphere adjusted");
         sphere.radius    = radius;
         sphere.isTrigger = true;
         sphere.enabled   = pa.IsEnabled();
         sphere.name      = Plugin.SphereColliderName;
     }
 }
            private static bool Prefix(WearNTear __instance, HitData hit)
            {
                if (WorldofValheimZones.ServerMode)
                {
                    return(true);
                }

                bool isInArea = false;

                // Is the area we are searching in a Warded area.
                if (Client.Ward.Damage && PrivateArea.CheckInPrivateArea(__instance.transform.position, false))
                {
                    ZDOID attacker = hit.m_attacker;
                    bool  isplayer = false;
                    foreach (var character in Character.GetAllCharacters())
                    {
                        if (character.GetZDOID() == attacker)
                        {
                            if (character.GetComponent <Player>())
                            {
                                isplayer = true;
                            }
                        }
                    }
                    // It's a player so lets see if it has access.
                    if (isplayer)
                    {
                        if (!PrivateArea.CheckAccess(Player.m_localPlayer.transform.position, 0f, true, false))
                        {
                            Util.DoAreaEffectW(__instance.transform.position);
                            MessageHud.instance.ShowMessage(MessageHud.MessageType.TopLeft, "This is a Warded Area", 0, null);
                            isInArea = true;
                            return(!isInArea);
                        }
                    }
                    else
                    {
                        // It's not a player so lets send out a Ward notification and block the damage.
                        PrivateArea.CheckInPrivateArea(__instance.transform.position, true);
                        isInArea = true;
                        return(!isInArea);
                    }
                }
                // Is the user restricted by NoBuildDamage?
                if (Util.RestrictionCheck("nobuilddamage"))
                {
                    isInArea = true;
                    Util.DoAreaEffect(__instance.transform.position + Vector3.up * 0.5f);
                    MessageHud.instance.ShowMessage(MessageHud.MessageType.TopLeft, "This is a Private Area", 0, null);
                }
                return(!isInArea);
            }
Example #27
0
        internal static void CopyPrivateArea(SeedTotem seedTotem, PrivateArea privateArea)
        {
            seedTotem.m_areaMarker = privateArea.m_areaMarker;

            seedTotem.m_enabledEffect = privateArea.m_enabledEffect;

            seedTotem.m_model = privateArea.m_model;

            seedTotem.m_areaMarker.gameObject.SetActive(value: false);
            seedTotem.m_areaMarker.m_radius       = configRadius.Value;
            seedTotem.m_areaMarker.m_nrOfSegments = 10;
            UpdateGlowColor(seedTotem);
        }
Example #28
0
            private static void SetEnabled_PostFix(PrivateArea __instance, bool enabled)
            {
                Plugin.Log($"GuardStone SetEnabled Called with {enabled}");

                try
                {
                    UpdateForceField(__instance, enabled);
                }
                catch (Exception ex)
                {
                    Plugin.LogError($"Exception GuardStoneTweakEnabled: {ex.Message}");
                }
            }
Example #29
0
 // Token: 0x06000F16 RID: 3862 RVA: 0x0006BDD7 File Offset: 0x00069FD7
 public bool Interact(Humanoid character, bool hold)
 {
     if (hold)
     {
         return(false);
     }
     if (!PrivateArea.CheckAccess(base.transform.position, 0f, true, false))
     {
         return(false);
     }
     TextInput.instance.RequestText(this, "$piece_sign_input", this.m_characterLimit);
     return(true);
 }
Example #30
0
    // Token: 0x06000E7E RID: 3710 RVA: 0x000679D0 File Offset: 0x00065BD0
    public static bool CheckAccess(Vector3 point, float radius = 0f, bool flash = true, bool wardCheck = false)
    {
        List <PrivateArea> list = new List <PrivateArea>();
        bool flag = true;

        if (wardCheck)
        {
            flag = true;
            using (List <PrivateArea> .Enumerator enumerator = PrivateArea.m_allAreas.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    PrivateArea privateArea = enumerator.Current;
                    if (privateArea.IsEnabled() && privateArea.IsInside(point, radius) && !privateArea.HaveLocalAccess())
                    {
                        flag = false;
                        list.Add(privateArea);
                    }
                }
                goto IL_B8;
            }
        }
        flag = false;
        foreach (PrivateArea privateArea2 in PrivateArea.m_allAreas)
        {
            if (privateArea2.IsEnabled() && privateArea2.IsInside(point, radius))
            {
                if (privateArea2.HaveLocalAccess())
                {
                    flag = true;
                }
                else
                {
                    list.Add(privateArea2);
                }
            }
        }
IL_B8:
        if (!flag && list.Count > 0)
        {
            if (flash)
            {
                foreach (PrivateArea privateArea3 in list)
                {
                    privateArea3.FlashShield(false);
                }
            }
            return(false);
        }
        return(true);
    }