From 49fc93ef5109bb8d66271cc2bb395d96c4b2d64c Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 15 Sep 2025 18:07:22 -0400 Subject: [PATCH] Restricted how much of the world ambient object placement is iterated over to make it much faster --- World/SunkenSea.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index 512140b7b5..a33f23598e 100644 --- a/World/SunkenSea.cs +++ b/World/SunkenSea.cs @@ -1529,10 +1529,12 @@ namespace CalamityMod.World //first clean up unnecessary chunks of tiles CleanOutSmallClumps(); - //just loop through the whole world and check for the specific tiles in the sunken sea because im lazy - for (int X = 20; X <= Main.maxTilesX - 20; X++) + // Loop through the area around the Sunken Sea and check for the specific tiles + int minX = Math.Max(20, GenVars.UndergroundDesertLocation.Left - 20); + int maxX = Math.Min(GenVars.UndergroundDesertLocation.Right + 20, Main.maxTilesX - 20); + for (int X = minX; X <= maxX; X++) { - for (int Y = 20; Y <= Main.maxTilesY - 20; Y++) + for (int Y = (int)Main.worldSurface; Y <= Main.UnderworldLayer; Y++) { if (WorldGen.genRand.NextBool(200)) WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(2), Actions.Chain(new GenAction[]