Skip to content

Commit

Permalink
Revert "Fix capture counting when analyzing a finished game"
Browse files Browse the repository at this point in the history
This broke end of game scoring

This reverts commit a7ecf71.
  • Loading branch information
anoek committed Jun 29, 2024
1 parent a7ecf71 commit 28c830e
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/engine/GobanEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1445,16 +1445,14 @@ export class GobanEngine extends BoardState {
ret.white.prisoners = this.white_prisoners;
ret.black.prisoners = this.black_prisoners;

if (this._cur_move === this.last_official_move) {
for (let y = 0; y < this.height; ++y) {
for (let x = 0; x < this.width; ++x) {
if (this.removal[y][x]) {
if (this.board[y][x] === JGOFNumericPlayerColor.BLACK) {
ret.white.prisoners += 1;
}
if (this.board[y][x] === JGOFNumericPlayerColor.WHITE) {
ret.black.prisoners += 1;
}
for (let y = 0; y < this.height; ++y) {
for (let x = 0; x < this.width; ++x) {
if (this.removal[y][x]) {
if (this.board[y][x] === JGOFNumericPlayerColor.BLACK) {
ret.white.prisoners += 1;
}
if (this.board[y][x] === JGOFNumericPlayerColor.WHITE) {
ret.black.prisoners += 1;
}
}
}
Expand Down

0 comments on commit 28c830e

Please sign in to comment.