From 6656c74842f9f6e2f2f4fc45e7af6ff115bf278b Mon Sep 17 00:00:00 2001 From: ephphatha Date: Mon, 25 Jul 2022 17:31:39 +1000 Subject: [PATCH] Use 0 as a default for non-random object placement tests --- Source/levels/themes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/levels/themes.cpp b/Source/levels/themes.cpp index 5893485d2..9e8c32b54 100644 --- a/Source/levels/themes.cpp +++ b/Source/levels/themes.cpp @@ -170,7 +170,7 @@ bool TFit_GoatShrine(int t) return false; } -bool CheckThemeObj3(Point origin, int8_t regionId, unsigned frequency = std::numeric_limits::max()) +bool CheckThemeObj3(Point origin, int8_t regionId, unsigned frequency = 0) { const PointsInRectangleRange searchArea { Rectangle { origin, 1 } }; return std::all_of(searchArea.cbegin(), searchArea.cend(), [regionId, frequency](Point testPosition) { @@ -187,7 +187,7 @@ bool CheckThemeObj3(Point origin, int8_t regionId, unsigned frequency = std::num if (IsObjectAtPosition(testPosition)) { return false; } - if (frequency != std::numeric_limits::max() && FlipCoin(frequency)) { + if (frequency > 0 && FlipCoin(frequency)) { return false; } return true;