From c207479589dade9b993ebc23ffd0422ea946ccef Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Wed, 17 May 2023 12:18:01 -0600 Subject: [PATCH] Fixed error while replaying moves to persistent opening bots in handicap games where the bot was black --- src/Bot.ts | 4 ++++ src/main.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Bot.ts b/src/Bot.ts index b61de2a3..8eb59fc0 100644 --- a/src/Bot.ts +++ b/src/Bot.ts @@ -612,6 +612,7 @@ export class Bot extends EventEmitter { !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]; @@ -621,6 +622,9 @@ export class Bot extends EventEmitter { 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; diff --git a/src/main.ts b/src/main.ts index da519f32..41ce8f68 100644 --- a/src/main.ts +++ b/src/main.ts @@ -232,7 +232,7 @@ class Main { continue; } - str += pool.stateString(); + str += pool.stateString() + " "; } trace.info(str);