From d05ceb9b7d9fb55538aa383692b522f537cb252c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Garro?= Date: Thu, 20 Oct 2022 02:03:13 -0300 Subject: [PATCH 1/3] fix #428 NH facts are required for Archaeologist --- NewHorizons/Patches/ShipLogPatches.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Patches/ShipLogPatches.cs b/NewHorizons/Patches/ShipLogPatches.cs index 6f45cd2f..8fe329c1 100644 --- a/NewHorizons/Patches/ShipLogPatches.cs +++ b/NewHorizons/Patches/ShipLogPatches.cs @@ -97,7 +97,7 @@ namespace NewHorizons.Patches { foreach (KeyValuePair keyValuePair in __instance._factDict) { - if (ShipLogHandler.IsVanillaAstroID(__instance.GetEntry(keyValuePair.Value.GetEntryID()).GetAstroObjectID()) && !keyValuePair.Value.IsRumor() && !keyValuePair.Value.IsRevealed() && !keyValuePair.Key.Equals("TH_VILLAGE_X3") && !keyValuePair.Key.Equals("GD_GABBRO_ISLAND_X1") && __instance.GetEntry(keyValuePair.Value.GetEntryID()).GetCuriosityName() != CuriosityName.InvisiblePlanet) + if (!ShipLogHandler.IsModdedFact(keyValuePair.Key) && !keyValuePair.Value.IsRumor() && !keyValuePair.Value.IsRevealed() && !keyValuePair.Key.Equals("TH_VILLAGE_X3") && !keyValuePair.Key.Equals("GD_GABBRO_ISLAND_X1") && __instance.GetEntry(keyValuePair.Value.GetEntryID()).GetCuriosityName() != CuriosityName.InvisiblePlanet) { return false; } From b604192a2b1fc89bda0b75ae5a33deb8e4378c94 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 20 Oct 2022 21:20:24 -0400 Subject: [PATCH 2/3] Include sector in the key for detail cache --- NewHorizons/Builder/Props/DetailBuilder.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 71b5a24e..cfb953ab 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -15,7 +15,7 @@ namespace NewHorizons.Builder.Props public static class DetailBuilder { private static readonly Dictionary _detailInfoToCorrespondingSpawnedGameObject = new(); - private static readonly Dictionary _fixedPrefabCache = new(); + private static readonly Dictionary<(Sector, string), (GameObject prefab, bool isItem)> _fixedPrefabCache = new(); static DetailBuilder() { @@ -82,7 +82,7 @@ namespace NewHorizons.Builder.Props bool isItem; // We save copies with all their components fixed, good if the user is placing the same detail more than once - if (detail?.path != null && _fixedPrefabCache.TryGetValue(detail.path, out var storedPrefab)) + if (detail?.path != null && _fixedPrefabCache.TryGetValue((sector, detail.path), out var storedPrefab)) { prop = storedPrefab.prefab.InstantiateInactive(); prop.name = prefab.name; @@ -114,7 +114,7 @@ namespace NewHorizons.Builder.Props if (detail.path != null) { - _fixedPrefabCache.Add(detail.path, (prop.InstantiateInactive(), isItem)); + _fixedPrefabCache.Add((sector, detail.path), (prop.InstantiateInactive(), isItem)); } } From ffb52cdcffcaf1117ab53a65fe9d5cc22171cdd8 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 20 Oct 2022 21:37:04 -0400 Subject: [PATCH 3/3] Bump version --- NewHorizons/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index 82831c0f..cfa7b760 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,7 +4,7 @@ "author": "xen, Bwc9876, clay, MegaPiggy, John, Hawkbar, Trifid, Book", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.7.0", + "version": "1.7.1", "owmlVersion": "2.7.2", "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ],