From e37845ec400eaf81978c0b2773f02f8f13a50afa Mon Sep 17 00:00:00 2001 From: Digitalroot Date: Mon, 7 Aug 2023 13:13:11 -0700 Subject: [PATCH] Update Main.cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #24, Jere — 08/05/2023 9:34 AM Each ZDO can save up to 255 of specific data type. Because [IG] changed count to byte. Currently save doesn't check for this and happily writes past the limit. (https://discord.com/channels/1094477020206993449/1094713280032948394/1137423481403879444) --- src/Digitalroot.Valheim.MaxDungeonRooms/Main.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Digitalroot.Valheim.MaxDungeonRooms/Main.cs b/src/Digitalroot.Valheim.MaxDungeonRooms/Main.cs index 23c7560..70e69b2 100644 --- a/src/Digitalroot.Valheim.MaxDungeonRooms/Main.cs +++ b/src/Digitalroot.Valheim.MaxDungeonRooms/Main.cs @@ -63,27 +63,27 @@ private void Awake() Config.SaveOnConfigSet = true; - MinRooms = Config.Bind("1. General", "Min Rooms", 20, new ConfigDescription("Min number of rooms in a dungeon.", new AcceptableValueRange(10, 1000), new ConfigurationManagerAttributes { IsAdminOnly = true, Browsable = true, Order = 1})); + MinRooms = Config.Bind("1. General", "Min Rooms", 20, new ConfigDescription("Min number of rooms in a dungeon.", new AcceptableValueRange(10, 120), new ConfigurationManagerAttributes { IsAdminOnly = true, Browsable = true, Order = 1})); MaxRooms = Config.Bind("1. General", "Max Rooms", 40, new ConfigDescription("Max number of rooms in a dungeon.", new AcceptableValueRange(10, 1000), new ConfigurationManagerAttributes { IsAdminOnly = true, Browsable = true, Order = 0})); // Blackforest EnableForestCryptOverride = Config.Bind("2. Forest Crypt Overrides", "Enable Forest Crypt Override", false, new ConfigDescription("Min number of rooms in a Forest Crypt dungeon.", tags: new ConfigurationManagerAttributes { IsAdminOnly = true, Browsable = true, Order = 100, IsAdvanced = true})); - ForestCryptOverrideMinRooms = Config.Bind("2. Forest Crypt Overrides", "Forest Crypt Min Rooms", 20, new ConfigDescription("Min number of rooms in a Forest Crypt dungeon.", new AcceptableValueRange(10, 1000), new ConfigurationManagerAttributes { IsAdminOnly = true, Browsable = true, Order = 1, IsAdvanced = true})); + ForestCryptOverrideMinRooms = Config.Bind("2. Forest Crypt Overrides", "Forest Crypt Min Rooms", 20, new ConfigDescription("Min number of rooms in a Forest Crypt dungeon.", new AcceptableValueRange(10, 120), new ConfigurationManagerAttributes { IsAdminOnly = true, Browsable = true, Order = 1, IsAdvanced = true})); ForestCryptOverrideMaxRooms = Config.Bind("2. Forest Crypt Overrides", "Forest Crypt Max Rooms", 40, new ConfigDescription("Max number of rooms in a Forest Crypt dungeon.", new AcceptableValueRange(10, 1000), new ConfigurationManagerAttributes { IsAdminOnly = true, Browsable = true, Order = 0, IsAdvanced = true})); // Swamp EnableSunkenCryptOverride = Config.Bind("3. Sunken Crypt Overrides", "Enable Sunken Crypt Override", false, new ConfigDescription("Min number of rooms in a Sunken Crypt dungeon.", tags: new ConfigurationManagerAttributes { IsAdminOnly = true, Browsable = true, Order = 100, IsAdvanced = true})); - SunkenCryptOverrideMinRooms = Config.Bind("3. Sunken Crypt Overrides", "Sunken Crypt Min Rooms", 20, new ConfigDescription("Min number of rooms in a Sunken Crypt dungeon.", new AcceptableValueRange(10, 1000), new ConfigurationManagerAttributes { IsAdminOnly = true, Browsable = true, Order = 1, IsAdvanced = true})); + SunkenCryptOverrideMinRooms = Config.Bind("3. Sunken Crypt Overrides", "Sunken Crypt Min Rooms", 20, new ConfigDescription("Min number of rooms in a Sunken Crypt dungeon.", new AcceptableValueRange(10, 120), new ConfigurationManagerAttributes { IsAdminOnly = true, Browsable = true, Order = 1, IsAdvanced = true})); SunkenCryptOverrideMaxRooms = Config.Bind("3. Sunken Crypt Overrides", "Sunken Crypt Max Rooms", 30, new ConfigDescription("Max number of rooms in a Sunken Crypt dungeon.", new AcceptableValueRange(10, 1000), new ConfigurationManagerAttributes { IsAdminOnly = true, Browsable = true, Order = 0, IsAdvanced = true})); // Mount EnableCaveOverride = Config.Bind("4. Cave Overrides", "Enable Cave Override", false, new ConfigDescription("Min number of rooms in a Cave dungeon.", tags: new ConfigurationManagerAttributes {IsAdminOnly = true, Browsable = true, Order = 100, IsAdvanced = true })); - CaveOverrideMinRooms = Config.Bind("4. Cave Overrides", "Cave Min Rooms", 20, new ConfigDescription("Min number of rooms in a Cave dungeon.", new AcceptableValueRange(10, 1000), new ConfigurationManagerAttributes {IsAdminOnly = true, Browsable = true, Order = 1, IsAdvanced = true })); + CaveOverrideMinRooms = Config.Bind("4. Cave Overrides", "Cave Min Rooms", 20, new ConfigDescription("Min number of rooms in a Cave dungeon.", new AcceptableValueRange(10, 120), new ConfigurationManagerAttributes {IsAdminOnly = true, Browsable = true, Order = 1, IsAdvanced = true })); CaveOverrideMaxRooms = Config.Bind("4. Cave Overrides", "Cave Max Rooms", 40, new ConfigDescription("Max number of rooms in a Cave dungeon.", new AcceptableValueRange(10, 1000), new ConfigurationManagerAttributes {IsAdminOnly = true, Browsable = true, Order = 0, IsAdvanced = true })); // Mistlands EnableDvergrTownOverride = Config.Bind("5. Dvergr Town Overrides", "Enable Dvergr Town Override", false, new ConfigDescription("Min number of rooms in a Dvergr Town dungeon.", tags: new ConfigurationManagerAttributes {IsAdminOnly = true, Browsable = true, Order = 100, IsAdvanced = true })); - DvergrTownOverrideMinRooms = Config.Bind("5. Dvergr Town Overrides", "Dvergr Town Min Rooms", 20, new ConfigDescription("Min number of rooms in a Dvergr Town dungeon.", new AcceptableValueRange(10, 1000), new ConfigurationManagerAttributes {IsAdminOnly = true, Browsable = true, Order = 1, IsAdvanced = true })); + DvergrTownOverrideMinRooms = Config.Bind("5. Dvergr Town Overrides", "Dvergr Town Min Rooms", 20, new ConfigDescription("Min number of rooms in a Dvergr Town dungeon.", new AcceptableValueRange(10, 120), new ConfigurationManagerAttributes {IsAdminOnly = true, Browsable = true, Order = 1, IsAdvanced = true })); DvergrTownOverrideMaxRooms = Config.Bind("5. Dvergr Town Overrides", "Dvergr Town Max Rooms", 40, new ConfigDescription("Max number of rooms in a Dvergr Town dungeon.", new AcceptableValueRange(10, 1000), new ConfigurationManagerAttributes {IsAdminOnly = true, Browsable = true, Order = 0, IsAdvanced = true })); _harmony = Harmony.CreateAndPatchAll(typeof(Main).Assembly, Guid);