Skip to content

Commit

Permalink
Fixed error while replaying moves to persistent opening bots in handi…
Browse files Browse the repository at this point in the history
…cap games where the bot was black
  • Loading branch information
anoek committed May 17, 2023
1 parent b862a6e commit c207479
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ export class Bot extends EventEmitter<Events> {
!have_initial_state && state.free_handicap_placement && state.handicap > 1;
const handicap_moves = [];
const moves = decodeMoves(state.moves, state.width, state.height);

for (let i = 0; i < moves.length; ++i) {
const move = moves[i];

Expand All @@ -621,6 +622,9 @@ export class Bot extends EventEmitter<Events> {
if (handicap_moves.length === state.handicap) {
if (do_initial_load) {
void this.sendHandicapMoves(handicap_moves, state.width, state.height);
if (this.persistent) {
this.persistent_moves_sent_count += handicap_moves.length;
}
}
} else {
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class Main {
continue;
}

str += pool.stateString();
str += pool.stateString() + " ";
}

trace.info(str);
Expand Down

0 comments on commit c207479

Please sign in to comment.