From 52b01775c2c94f08786696cae7836ca56f683739 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Tue, 19 Nov 2019 09:42:45 -0800 Subject: Fix RNG -- this will break seeds, though. --- Source/Randomizer2Core.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Source/Randomizer2Core.cpp') diff --git a/Source/Randomizer2Core.cpp b/Source/Randomizer2Core.cpp index 0310ae2..c34fec6 100644 --- a/Source/Randomizer2Core.cpp +++ b/Source/Randomizer2Core.cpp @@ -77,15 +77,22 @@ std::vector Randomizer2Core::CutEdgesInternal(const Puzzle& p, std::vector< return cutEdges; } +#ifndef NDEBUG +#include +#endif + void Randomizer2Core::DebugColorGrid(const std::vector>& colorGrid) { +#ifndef NDEBUG for (int y=0; y>& colorGrid, int color, int x, int y) { @@ -102,7 +109,7 @@ void Randomizer2Core::FloodFill(const Puzzle& p, std::vector>& void Randomizer2Core::FloodFillOutside(const Puzzle& p, std::vector>& colorGrid, int x, int y) { if (!p.SafeCell(x, y)) return; if (colorGrid[x][y] != 0) return; // Already processed. - if (x%2 != y%2 && p.grid[x][y].gap != Cell::Gap::FULL) return; // Only flood-fill through full gaps + if (x%2 != y%2 && p.grid[x][y].gap == Cell::Gap::NONE) return; // Only flood-fill through gaps colorGrid[x][y] = 1; // Outside color FloodFillOutside(p, colorGrid, x, y+1); -- cgit 1.4.1