From 828b560e5eb89fdcfd41680f84f4cbfd1281c03d Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 1 Apr 2020 10:44:30 -0700 Subject: [PATCH] Extend recipe max for v1.1 the whole array is probably 0x100 bytes (max recipe ID 0x800), but we can clamp things by only reading a certain amount (dump RecipeCraftParam.bcsv and add the bunny craftables to the recipe list...) --- NHSE.Core/Save/Offsets/PersonalOffsets.cs | 2 +- NHSE.Core/Save/Offsets/PersonalOffsets11.cs | 2 ++ NHSE.WinForms/Subforms/RecipeListEditor.cs | 5 +---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/NHSE.Core/Save/Offsets/PersonalOffsets.cs b/NHSE.Core/Save/Offsets/PersonalOffsets.cs index 4e70fc3..46304f0 100644 --- a/NHSE.Core/Save/Offsets/PersonalOffsets.cs +++ b/NHSE.Core/Save/Offsets/PersonalOffsets.cs @@ -25,7 +25,7 @@ public abstract class PersonalOffsets public int Pockets1Count { get; } = 20; public int Pockets2Count { get; } = 20; public int StorageCount { get; } = 5000; - public int MaxRecipeID { get; } = 0x2A0; + public virtual int MaxRecipeID { get; } = 0x2A0; public static PersonalOffsets GetOffsets(FileHeaderInfo Info) { diff --git a/NHSE.Core/Save/Offsets/PersonalOffsets11.cs b/NHSE.Core/Save/Offsets/PersonalOffsets11.cs index 3f6b3d4..5d82f0f 100644 --- a/NHSE.Core/Save/Offsets/PersonalOffsets11.cs +++ b/NHSE.Core/Save/Offsets/PersonalOffsets11.cs @@ -18,5 +18,7 @@ public sealed class PersonalOffsets11 : PersonalOffsets public override int Bank => 0x68C34; // +0x50 from v1.0 public override int Recipes => 0x68C44; // + 0x50 from v1.0 + + public override int MaxRecipeID { get; } = 0x2C8; } } \ No newline at end of file diff --git a/NHSE.WinForms/Subforms/RecipeListEditor.cs b/NHSE.WinForms/Subforms/RecipeListEditor.cs index ab19367..bb77e39 100644 --- a/NHSE.WinForms/Subforms/RecipeListEditor.cs +++ b/NHSE.WinForms/Subforms/RecipeListEditor.cs @@ -1,5 +1,4 @@ using System; -using System.Linq; using System.Windows.Forms; using NHSE.Core; using NHSE.Core.Structures; @@ -23,9 +22,7 @@ public RecipeListEditor(Player player) private void FillCheckBoxes() { var recipes = RecipeList.Recipes; - var max = recipes.Max(z => z.Key); - if (Known.Length < max) - max = (ushort)Known.Length; + var max = (ushort)Known.Length - 1; var strings = GameInfo.Strings.itemlist; for (ushort i = 0; i <= max; i++)