From be3f77d02b0a3d4565de7cbaa32cde30cae79557 Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Mon, 4 Aug 2025 22:23:07 -0400 Subject: [PATCH] Revert "fix error" This reverts commit 2e07c93fc45c2511084b66ff9ffd810e266ad86d. --- NewHorizons/Builder/Props/ScatterBuilder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Builder/Props/ScatterBuilder.cs b/NewHorizons/Builder/Props/ScatterBuilder.cs index b3d55987..0df720d6 100644 --- a/NewHorizons/Builder/Props/ScatterBuilder.cs +++ b/NewHorizons/Builder/Props/ScatterBuilder.cs @@ -83,8 +83,8 @@ namespace NewHorizons.Builder.Props bool reasonableHeightConstraints = true; if (!propInfo.preventOverlap && (heightMapTexture != null) && (propInfo.minHeight != null || propInfo.maxHeight != null)) // If caution is relevant { - var maxHeight = (propInfo.maxHeight != null ? Math.Min(propInfo.maxHeight.Value, heightMap.maxHeight) : heightMap.maxHeight); - var minHeight = (propInfo.minHeight != null ? Math.Max(propInfo.minHeight.Value, heightMap.minHeight) : heightMap.minHeight); + var maxHeight = (propInfo.maxHeight != null ? Math.Min(propInfo.maxHeight, heightMap.maxHeight) : heightMap.maxHeight); + var minHeight = (propInfo.minHeight != null ? Math.Max(propInfo.minHeight, heightMap.minHeight) : heightMap.minHeight); if ((maxHeight - minHeight) / (heightMap.maxHeight - heightMap.minHeight) < 0.001) // If height roll has less than 0.1% chance of being valid { NHLogger.LogError($"Ignoring minHeight/maxHeight for scatter of [{scatterPrefab.name}] to prevent infinite rerolls from too much constraint on height.");