From b5dc753b6a74c8fb98ff35a348c286df24c3248e Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 24 Feb 2025 15:24:56 -0500 Subject: Fix rainbow tree not growing --- GameplayPatches.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/GameplayPatches.cs b/GameplayPatches.cs index 37a671d..b2b8e54 100644 --- a/GameplayPatches.cs +++ b/GameplayPatches.cs @@ -1,6 +1,7 @@ using HarmonyLib; using System.Reflection; using UnityEngine; +using static ManifoldGardenArchipelago.Requirement; namespace ManifoldGardenArchipelago { @@ -271,9 +272,18 @@ namespace ManifoldGardenArchipelago [HarmonyPatch(typeof(DarkModeCollapsedCubeWorldGrow), nameof(DarkModeCollapsedCubeWorldGrow.OnChainFillComplete))] static class DarkModeCollapsedCubeWorldGrowOnChainFillCompletePatch { - static bool Prefix() + static bool Prefix(DarkModeCollapsedCubeWorldGrow __instance) { - return false; + SceneItemReference sir = GameState.GetChainListenerSceneReference(__instance); + + if (GameData.scenes.TryGetValue(sir.scene, out var sceneDescription) && + sceneDescription.worldGrows.TryGetValue(sir.index, out var requirement) && + requirement.Check() != Requirement.Decision.Yes) + { + return false; + } + + return true; } } -- cgit 1.4.1