From db4c69fbfd05e05bd95204be55699fb0bd058c4f Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 10 Mar 2026 21:28:17 -0400 Subject: [PATCH] Shimmer Shrine has some horizontal leniency in its generation --- World/ShimmerShrine.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/World/ShimmerShrine.cs b/World/ShimmerShrine.cs index 7beb14fd6c..67220466ef 100644 --- a/World/ShimmerShrine.cs +++ b/World/ShimmerShrine.cs @@ -20,6 +20,23 @@ namespace CalamityMod.World int placementPositionY = (int)Main.worldSurface - 300; int offset = 28; + int width = schematic.GetLength(0); + int height = schematic.GetLength(1); + // If the point directly above the shimmer is blocked by something, try to move to the side a bit + if (!structures.CanPlace(new Rectangle(placementPositionX - width, placementPositionY - height, width, height))) + { + int attempts = 0; + while (attempts < 1000) + { + attempts++; + placementPositionX = Main.rand.Next((int)GenVars.shimmerPosition.X - 100, (int)GenVars.shimmerPosition.X + 100); + if (structures.CanPlace(new Rectangle(placementPositionX - width, placementPositionY - height, width, height))) + break; + } + // If still not good, just give up and place it directly above the shimmer regardless + placementPositionX = (int)GenVars.shimmerPosition.X; + } + while (!Main.tile[placementPositionX, placementPositionY].HasTile) placementPositionY++;