Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Generate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ bool Generate::generate_path(PuzzleSymbols & symbols)

//For stone puzzles, the path must have a certain number of regions
if (symbols.style == Panel::Style::HAS_STONES && _splitPoints.size() == 0)
return generate_path_regions(min(symbols.getNum(Decoration::Stone), (_panel->_width / 2 + _panel->_height / 2) / 2 + 1));
return generate_path_regions(std::min(symbols.getNumColors(Decoration::Stone), (_panel->_width / 2 + _panel->_height / 2) / 2 + 1));

if (symbols.style == Panel::Style::HAS_SHAPERS) {
if (hasFlag(Config::SplitShapes)) {
Expand Down
5 changes: 5 additions & 0 deletions Source/PuzzleSymbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ struct PuzzleSymbols {
for (auto& pair : symbols[symbolType]) total += pair.second;
return total;
}
int getNumColors(int symbolType) {
int total = 0;
for (auto& pair : symbols[symbolType]) total += 1;
return total;
}
bool any(int symbolType) { return symbols[symbolType].size() > 0; }
int popRandomSymbol() {
std::vector<int> types;
Expand Down