From bd396539872030f156da458591827e3547446b74 Mon Sep 17 00:00:00 2001 From: rooklift <16438795+rooklift@users.noreply.github.com> Date: Sun, 3 Mar 2024 11:50:03 +0000 Subject: [PATCH] Fix want_to_go when clicking for the engine --- src/modules/hub.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/modules/hub.js b/src/modules/hub.js index 5c01d54c..4bc7755d 100644 --- a/src/modules/hub.js +++ b/src/modules/hub.js @@ -396,7 +396,16 @@ let hub_main_props = { // Figure out whether we want the engine to be running... - let want_to_go = Boolean(this.engine.desired) || this.playing_active_colour(); + let want_to_go; + + // want_to_go = Boolean(this.engine.desired) || this.playing_active_colour(); -- is a WRONG AND BAD TEST. + // Caused Issue 120. If playing vs the machine, but we click for it, this test gave the wrong outcome. + + if ([PLAY_BLACK, PLAY_WHITE].includes(this.play_mode)) { + want_to_go = this.playing_active_colour(); + } else { + want_to_go = Boolean(this.engine.desired); + } if (!opts.keep_selfplay && this.play_mode === SELFPLAY) { this.set_play_mode(NORMAL);