diff options
| -rw-r--r-- | GameplayPatches.cs | 14 | 
1 files 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 @@ | |||
| 1 | using HarmonyLib; | 1 | using HarmonyLib; | 
| 2 | using System.Reflection; | 2 | using System.Reflection; | 
| 3 | using UnityEngine; | 3 | using UnityEngine; | 
| 4 | using static ManifoldGardenArchipelago.Requirement; | ||
| 4 | 5 | ||
| 5 | namespace ManifoldGardenArchipelago | 6 | namespace ManifoldGardenArchipelago | 
| 6 | { | 7 | { | 
| @@ -271,9 +272,18 @@ namespace ManifoldGardenArchipelago | |||
| 271 | [HarmonyPatch(typeof(DarkModeCollapsedCubeWorldGrow), nameof(DarkModeCollapsedCubeWorldGrow.OnChainFillComplete))] | 272 | [HarmonyPatch(typeof(DarkModeCollapsedCubeWorldGrow), nameof(DarkModeCollapsedCubeWorldGrow.OnChainFillComplete))] | 
| 272 | static class DarkModeCollapsedCubeWorldGrowOnChainFillCompletePatch | 273 | static class DarkModeCollapsedCubeWorldGrowOnChainFillCompletePatch | 
| 273 | { | 274 | { | 
| 274 | static bool Prefix() | 275 | static bool Prefix(DarkModeCollapsedCubeWorldGrow __instance) | 
| 275 | { | 276 | { | 
| 276 | return false; | 277 | SceneItemReference sir = GameState.GetChainListenerSceneReference(__instance); | 
| 278 | |||
| 279 | if (GameData.scenes.TryGetValue(sir.scene, out var sceneDescription) && | ||
| 280 | sceneDescription.worldGrows.TryGetValue(sir.index, out var requirement) && | ||
| 281 | requirement.Check() != Requirement.Decision.Yes) | ||
| 282 | { | ||
| 283 | return false; | ||
| 284 | } | ||
| 285 | |||
| 286 | return true; | ||
| 277 | } | 287 | } | 
| 278 | } | 288 | } | 
| 279 | 289 | ||
