Fixes#2010
It was intended that all the various codepaths call `resetAI()` to
initialize the promise handling. However, when there is no savegame at
all, `loadGo()` is not even called, so this is skipped, and the promises
remain not-fully-initialized. This puts the initialization as part of
the static construction, guaranteeing a fix.
Tested all 3 scenarios in #2010, as well as two more:
* Delete save, immediately "Find new subnet".
* Play a move, save game, ensure IPvGO works on reload.
* Play a move, save game *before the AI moves*, ensure that the AI plays
different random moves on reload.
Change dev version from 2.7.1 to 2.8.0
Also adjust the save data migration code for the latest check to use "<"
instead of "<=" to agree with the style of everything else.
(I noticed this due to investistigating bumping the version, but that
happens as part of the release commit so it shouldn't be done yet.)
* UI: Add disambiguation to the confusing "1s / ls" tutorial step, and a general "did you mean" to the terminal
* UI: Add disambiguation to the confusing "1s / ls" tutorial step, and a general "did you mean" to the terminal
* Prevent duplicate suggestions
* Update src/Terminal/Terminal.ts
Co-authored-by: David Walker <d0sboots@gmail.com>
* Prevent duplicate suggestions
---------
Co-authored-by: David Walker <d0sboots@gmail.com>
This is a big change with a *lot* of moving parts.
The largest part of it is enabling scripts to `playAsWhite` as a parameter to many Go functions. In the implementation, this involved a significant rewrite of `opponentNextTurn` promise handling.
A number of other changes and bugfixes are included:
* Fixes the issue where handicap stones are added on game load.
* Better typing for error callbacks.
* Throw errors instead of deadlocking on bad cheat usage.
* Return always-resolved gameOver promise after game end
* Added a new `resetStats` api function.
---------
Co-authored-by: David Walker <d0sboots@gmail.com>