Пример #1
0
        private object CanLootEntity(BasePlayer player, StorageContainer container)
        {
            BaseEntity fridge = container.GetComponentInParent <BaseEntity>();

            if (fridge.ShortPrefabName.Equals("fridge.deployed"))
            {
                ElectricalHeater electrified = container.GetComponentInChildren <ElectricalHeater>() ?? null;
                if (electrified == null)
                {
                    return(null);
                }
                if (!electrified.IsPowered() && configData.Settings.blockLooting)
                {
                    return(false);
                }

                string status = Lang("off");
                if (electrified.IsPowered())
                {
                    status = Lang("on");
                }

                PowerGUI(player, status);
            }
            return(null);
        }