diff --git a/engine/aftermath.c b/engine/aftermath.c
index b295a89..0d24525 100644
|
a
|
b
|
play_aftermath(int color, SGFTree *aftermath_sgftree) |
| 1143 | 1143 | a->final_status[pos] = ALIVE; |
| 1144 | 1144 | } |
| 1145 | 1145 | else { |
| 1146 | | if (board[pos] == EMPTY) |
| | 1146 | if (board[pos] == EMPTY) { |
| | 1147 | int enclosing_color = examine_cavity(pos, NULL); |
| 1147 | 1148 | a->final_status[pos] = DAME; |
| | 1149 | if (enclosing_color == BLACK) |
| | 1150 | a->black_area++; |
| | 1151 | else if (enclosing_color == WHITE) |
| | 1152 | a->white_area++; |
| | 1153 | } |
| 1148 | 1154 | else { |
| 1149 | 1155 | a->final_status[pos] = ALIVE_IN_SEKI; |
| 1150 | 1156 | if (board[pos] == WHITE) |
diff --git a/engine/liberty.h b/engine/liberty.h
index 416cd29..2da94e2 100644
|
a
|
b
|
void get_lively_stones(int color, signed char safe_stones[BOARDMAX]); |
| 333 | 333 | int is_same_worm(int w1, int w2); |
| 334 | 334 | int is_worm_origin(int w, int pos); |
| 335 | 335 | void propagate_worm(int pos); |
| | 336 | int examine_cavity(int pos, int *edge); |
| 336 | 337 | void find_cuts(void); |
| 337 | 338 | void find_connections(void); |
| 338 | 339 | |
diff --git a/engine/worm.c b/engine/worm.c
index 55dfc7f..5fedcf9 100644
|
a
|
b
|
static void change_tactical_point(int str, int move, int code, |
| 44 | 44 | static void propagate_worm2(int str); |
| 45 | 45 | static int genus(int str); |
| 46 | 46 | static void markcomponent(int str, int pos, int mg[BOARDMAX]); |
| 47 | | static int examine_cavity(int pos, int *edge); |
| 48 | 47 | static void cavity_recurse(int pos, int mx[BOARDMAX], |
| 49 | 48 | int *border_color, int *edge, int str); |
| 50 | 49 | static void ping_cave(int str, int *result1, int *result2, |
| … |
… |
markcomponent(int str, int pos, int mg[BOARDMAX]) |
| 1460 | 1459 | * edge in a point outside the removed string. |
| 1461 | 1460 | */ |
| 1462 | 1461 | |
| 1463 | | static int |
| | 1462 | int |
| 1464 | 1463 | examine_cavity(int pos, int *edge) |
| 1465 | 1464 | { |
| 1466 | 1465 | int border_color = EMPTY; |
| … |
… |
examine_cavity(int pos, int *edge) |
| 1468 | 1467 | int origin = NO_MOVE; |
| 1469 | 1468 | |
| 1470 | 1469 | ASSERT_ON_BOARD1(pos); |
| 1471 | | gg_assert(edge != NULL); |
| 1472 | 1470 | |
| 1473 | 1471 | memset(ml, 0, sizeof(ml)); |
| 1474 | 1472 | |
| 1475 | | *edge = 0; |
| | 1473 | if (edge) |
| | 1474 | *edge = 0; |
| 1476 | 1475 | |
| 1477 | 1476 | if (IS_STONE(board[pos])) |
| 1478 | 1477 | origin = find_origin(pos); |
| … |
… |
cavity_recurse(int pos, int mx[BOARDMAX], |
| 1524 | 1523 | |
| 1525 | 1524 | mx[pos] = 1; |
| 1526 | 1525 | |
| 1527 | | if (is_edge_vertex(pos) && board[pos] == EMPTY) |
| | 1526 | if (edge && is_edge_vertex(pos) && board[pos] == EMPTY) |
| 1528 | 1527 | (*edge)++; |
| 1529 | 1528 | |
| 1530 | 1529 | /* Loop over the four neighbors. */ |