aboutsummaryrefslogtreecommitdiff
path: root/src/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/board.c')
-rw-r--r--src/board.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/board.c b/src/board.c
index 92420ed..cc16e06 100644
--- a/src/board.c
+++ b/src/board.c
@@ -58,11 +58,10 @@ void traverse_structure(int group, int index, BoardUnit* board) {
int new_unit = index + NEIGHBOR_INCREMENTS[i];
if (board[new_unit].feature == board[index].feature && board[new_unit].structure_group == 0) {
traverse_structure(group, new_unit, board);
- }
- else if (board[new_unit].feature == '*' && board[new_unit].structure_group != board[index].structure_group) {
+ } else if (board[new_unit].feature == ANY && board[new_unit].structure_group != board[index].structure_group) {
board[new_unit].feature = board[index].feature;
traverse_structure(group, new_unit, board);
- board[new_unit].feature = '*';
+ board[new_unit].feature = ANY;
}
}
}
@@ -72,7 +71,12 @@ void refresh_structure_groups(BoardUnit* board) {
int structure_group = 1;
for (int i = 0; i < BOARD_UNITS; i++) {
- if (board[i].structure_group == 0 && board[i].feature != EMPTY && board[i].feature != 'F') {
+ if (
+ board[i].structure_group == 0
+ && board[i].feature != EMPTY
+ && board[i].feature != SEPARATOR
+ && board[i].feature != 'F'
+ ) {
traverse_structure(structure_group, i, board);
structure_group += 1;
}