herzbube / littlego

Little Go. An iOS application that lets you play the game of Go on the iPhone or iPad.
https://littlego.herzbube.ch/
Apache License 2.0
138 stars 54 forks source link

Handicap points as well as black and white setup points are not synced correctly with Fuego #430

Closed herzbube closed 3 months ago

herzbube commented 3 months ago
  1. Create a new game with handicap >= 2
  2. Play a white move
  3. Navigate back to the root node
  4. Examine the GTP log

Expected: A command "gogui-setup" was sent to the GTP engine that contains the handicap stones. Actual: No command "gogui-setup" was sent to the GTP engine.

The issue also occurs without navigating back to a previous node, when the app is restarted and tries to sync the GTP engine with the application state.

The usual symptoms of a de-sync between the app and Fuego occur - Fuego tries to play on an occupied intersection, etc.

herzbube commented 3 months ago

The issue is a regression in SyncGTPEngineCommand.m, introduced in commit 4a2dcf284c51366e016a1a67085a82f10abeeadb when the line

if (game.blackSetupPoints.count == 0 && game.whiteSetupPoints.count == 0)

was changed to

if (blackSetupPoints.count == 0 || whiteSetupPoints.count == 0)

Note the change of the logical operator from && to ||.