diff --git a/Tools/Scripts/MapGenerator.cs b/Tools/Scripts/MapGenerator.cs index ccbc7fb..40528cb 100644 --- a/Tools/Scripts/MapGenerator.cs +++ b/Tools/Scripts/MapGenerator.cs @@ -540,8 +540,13 @@ public partial class MapGenerator : TextureRect float craterDepth = 1.0f - (distToCrater / physicalCraterRadius); // Dialed back to -0.15f as per your excellent instinct! float carveTarget = GetSeaLevel(_tempMap[x, y]) - 0.15f; - _heightMapClassify[x, y] = Mathf.Lerp(_heightMapClassify[x, y], carveTarget, craterDepth * 0.9f); - _heightMap[x, y] = Mathf.Lerp(_heightMap[x, y], carveTarget, craterDepth * 0.9f); + // Read BOTH before writing EITHER: with the curve off the two maps + // alias the same array, and a sequential read-modify-write carved + // the crater twice (caught by the task-10 continuity oracle). + float preClassify = _heightMapClassify[x, y]; + float preCurved = _heightMap[x, y]; + _heightMapClassify[x, y] = Mathf.Lerp(preClassify, carveTarget, craterDepth * 0.9f); + _heightMap[x, y] = Mathf.Lerp(preCurved, carveTarget, craterDepth * 0.9f); } } }