## Bug fixes
- Fixes details with sectored based scripts on them being broken if you
put them on multiple planets.
- Modded facts are no longer required for the Archaeologist achievement
This commit is contained in:
Nick 2022-10-20 21:42:29 -04:00 committed by GitHub
commit b0119697a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,7 @@ namespace NewHorizons.Builder.Props
public static class DetailBuilder public static class DetailBuilder
{ {
private static readonly Dictionary<PropModule.DetailInfo, GameObject> _detailInfoToCorrespondingSpawnedGameObject = new(); private static readonly Dictionary<PropModule.DetailInfo, GameObject> _detailInfoToCorrespondingSpawnedGameObject = new();
private static readonly Dictionary<string, (GameObject prefab, bool isItem)> _fixedPrefabCache = new(); private static readonly Dictionary<(Sector, string), (GameObject prefab, bool isItem)> _fixedPrefabCache = new();
static DetailBuilder() static DetailBuilder()
{ {
@ -82,7 +82,7 @@ namespace NewHorizons.Builder.Props
bool isItem; bool isItem;
// We save copies with all their components fixed, good if the user is placing the same detail more than once // 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 = storedPrefab.prefab.InstantiateInactive();
prop.name = prefab.name; prop.name = prefab.name;
@ -114,7 +114,7 @@ namespace NewHorizons.Builder.Props
if (detail.path != null) if (detail.path != null)
{ {
_fixedPrefabCache.Add(detail.path, (prop.InstantiateInactive(), isItem)); _fixedPrefabCache.Add((sector, detail.path), (prop.InstantiateInactive(), isItem));
} }
} }

View File

@ -97,7 +97,7 @@ namespace NewHorizons.Patches
{ {
foreach (KeyValuePair<string, ShipLogFact> keyValuePair in __instance._factDict) foreach (KeyValuePair<string, ShipLogFact> 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; return false;
} }

View File

@ -4,7 +4,7 @@
"author": "xen, Bwc9876, clay, MegaPiggy, John, Hawkbar, Trifid, Book", "author": "xen, Bwc9876, clay, MegaPiggy, John, Hawkbar, Trifid, Book",
"name": "New Horizons", "name": "New Horizons",
"uniqueName": "xen.NewHorizons", "uniqueName": "xen.NewHorizons",
"version": "1.7.0", "version": "1.7.1",
"owmlVersion": "2.7.2", "owmlVersion": "2.7.2",
"dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ],
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ],