diff --git a/Example mod/Mod.cs b/Example mod/Mod.cs index fd58a1d2..2ee6978b 100644 --- a/Example mod/Mod.cs +++ b/Example mod/Mod.cs @@ -21,7 +21,7 @@ private const string MODNAME = "SMLHelper", AUTHOR = "The SMLHelper Dev Team", GUID = "SMLHelperExampleMod", - VERSION = "2.15.0.0"; + VERSION = "2.15.0.1"; internal static ManualLogSource LogSource { get; private set; } diff --git a/SMLHelper/Handlers/KnownTechHandler.cs b/SMLHelper/Handlers/KnownTechHandler.cs index 31fab56e..f8289add 100644 --- a/SMLHelper/Handlers/KnownTechHandler.cs +++ b/SMLHelper/Handlers/KnownTechHandler.cs @@ -62,7 +62,10 @@ internal void AddAnalysisTech(TechType techTypeToBeAnalysed, IEnumerable(techTypesToUnlock) + unlockTechTypes = new List(techTypesToUnlock), + //Secondary fix for null ref exception caused by Subnautica 2.0 moving story goal initialization + //Maybe one day we expand this to actually be able to add list of StoryGoals from mods or base game??? + storyGoals = new() }); } } diff --git a/SMLHelper/Initializer.cs b/SMLHelper/Initializer.cs index 014060de..78a86131 100644 --- a/SMLHelper/Initializer.cs +++ b/SMLHelper/Initializer.cs @@ -20,7 +20,7 @@ public class Initializer: BaseUnityPlugin private const string MODNAME = "SMLHelper", GUID = "com.ahk1221.smlhelper", - VERSION = "2.15.0.0"; + VERSION = "2.15.0.1"; internal static readonly Harmony harmony = new Harmony(GUID); diff --git a/SMLHelper/Patchers/KnownTechPatcher.cs b/SMLHelper/Patchers/KnownTechPatcher.cs index 00133c81..13c3c097 100644 --- a/SMLHelper/Patchers/KnownTechPatcher.cs +++ b/SMLHelper/Patchers/KnownTechPatcher.cs @@ -74,7 +74,8 @@ internal static void InitializePostfix() } } - foreach (KnownTech.AnalysisTech tech in techToAdd) + List validatedTechsToAdd = KnownTech.ValidateAnalysisTech(new(techToAdd)); + foreach (KnownTech.AnalysisTech tech in validatedTechsToAdd) { if (tech == null) continue; @@ -86,18 +87,18 @@ internal static void InitializePostfix() analysisTech.Add(tech); } - List compoundTech = KnownTech.compoundTech; - foreach (KnownTech.CompoundTech customTech in CompoundTech.Values) + List validatedCompoundTeches = KnownTech.ValidateCompoundTech(new(CompoundTech.Values)); + foreach (KnownTech.CompoundTech customTech in validatedCompoundTeches) { if (customTech == null) // Safety check continue; // Only add the new compound tech if it isn't unlocked yet if (!KnownTech.Contains(customTech.techType)) - compoundTech.Add(customTech); + KnownTech.compoundTech.Add(customTech); // If a compound tech already exists, set the dependencies correctly. - var foundTech = compoundTech.Find(tech => tech.techType == customTech.techType); + var foundTech = KnownTech.compoundTech.Find(tech => tech.techType == customTech.techType); if (foundTech != null) foundTech.dependencies = customTech.dependencies; } diff --git a/SMLHelper/ThunderstoreMetadata/BZ.EXP/manifest.json b/SMLHelper/ThunderstoreMetadata/BZ.EXP/manifest.json index 4e3c0baa..258006bc 100644 --- a/SMLHelper/ThunderstoreMetadata/BZ.EXP/manifest.json +++ b/SMLHelper/ThunderstoreMetadata/BZ.EXP/manifest.json @@ -1,6 +1,6 @@ { "name": "SMLHelper_BZ_Experimental", - "version_number": "2.15.0000", + "version_number": "2.15.0001", "website_url": "https://github.com/SubnauticaModding/SMLHelper/wiki", "description": "SMLHelper is a modding library that helps making mods easier by helping with adding new items, changing items, adding models, sprites, etc.", "dependencies": [ "Subnautica_Modding-BepInExPack-5.4.2101" ] diff --git a/SMLHelper/ThunderstoreMetadata/BZ.STABLE/manifest.json b/SMLHelper/ThunderstoreMetadata/BZ.STABLE/manifest.json index d0349492..869098fe 100644 --- a/SMLHelper/ThunderstoreMetadata/BZ.STABLE/manifest.json +++ b/SMLHelper/ThunderstoreMetadata/BZ.STABLE/manifest.json @@ -1,6 +1,6 @@ { "name": "SMLHelper_BZ", - "version_number": "2.15.0000", + "version_number": "2.15.0001", "website_url": "https://github.com/SubnauticaModding/SMLHelper/wiki", "description": "SMLHelper is a modding library that helps making mods easier by helping with adding new items, changing items, adding models, sprites, etc.", "dependencies": [ "Subnautica_Modding-BepInExPack-5.4.2101" ] diff --git a/SMLHelper/ThunderstoreMetadata/SN.EXP/manifest.json b/SMLHelper/ThunderstoreMetadata/SN.EXP/manifest.json index d764c81b..1278ade1 100644 --- a/SMLHelper/ThunderstoreMetadata/SN.EXP/manifest.json +++ b/SMLHelper/ThunderstoreMetadata/SN.EXP/manifest.json @@ -1,6 +1,6 @@ { "name": "SMLHelper_Experimental", - "version_number": "2.15.0000", + "version_number": "2.15.0001", "website_url": "https://github.com/SubnauticaModding/SMLHelper/wiki", "description": "SMLHelper is a modding library that helps making mods easier by helping with adding new items, changing items, adding models, sprites, etc.", "dependencies": [ "Subnautica_Modding-BepInExPack-5.4.2101" ] diff --git a/SMLHelper/ThunderstoreMetadata/SN.STABLE/manifest.json b/SMLHelper/ThunderstoreMetadata/SN.STABLE/manifest.json index daf2aab7..9deb3a67 100644 --- a/SMLHelper/ThunderstoreMetadata/SN.STABLE/manifest.json +++ b/SMLHelper/ThunderstoreMetadata/SN.STABLE/manifest.json @@ -1,6 +1,6 @@ { "name": "SMLHelper", - "version_number": "2.15.0000", + "version_number": "2.15.0001", "website_url": "https://github.com/SubnauticaModding/SMLHelper/wiki", "description": "SMLHelper is a modding library that helps making mods easier by helping with adding new items, changing items, adding models, sprites, etc.", "dependencies": [ "Subnautica_Modding-BepInExPack-5.4.2101" ] diff --git a/Version.targets b/Version.targets index 2b68597f..4348acbb 100644 --- a/Version.targets +++ b/Version.targets @@ -2,6 +2,6 @@ - 2.15.0 + 2.15.0.1 \ No newline at end of file