From 48ef8131d10aecfb6fbbda99c1149f4f9f4a6e06 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Wed, 26 Jun 2024 22:23:07 +0200 Subject: [PATCH] Safety check for dungeon relocation in XL worlds --- ILEditing/WorldgenILChanges.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ILEditing/WorldgenILChanges.cs b/ILEditing/WorldgenILChanges.cs index 67f4682353..345bb65fac 100644 --- a/ILEditing/WorldgenILChanges.cs +++ b/ILEditing/WorldgenILChanges.cs @@ -209,8 +209,11 @@ namespace CalamityMod.ILEditing // Adjust the Y position of the dungeon to accomodate for the X shift, so that if the clamp shoves the dungeon into the air it has an // opportunity to ground itself again. - WorldUtils.Find(new Point(x, y), Searches.Chain(new Searches.Down(9001), new Conditions.IsSolid()), out Point result); - y = result.Y - 10; + // + // 26JUN2024: Ozzatron: fix bug where this search fails for god-unknown reasons on XL worlds and the dungeon doesn't place + bool betterPointFound = WorldUtils.Find(new Point(x, y), Searches.Chain(new Searches.Down(9001), new Conditions.IsSolid()), out Point result); + if (betterPointFound) + y = result.Y - 10; orig(x, y); }