chiark / gitweb /
Galaxies: prevent creation of empty undo-chain items.
authorSimon Tatham <anakin@pobox.com>
Mon, 18 Feb 2019 21:12:16 +0000 (21:12 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 18 Feb 2019 21:12:16 +0000 (21:12 +0000)
commit68363231f062192156799af7a153fc3ab3a0f5ed
treefa98d0f1113c30340830f868d11453f772206d04
parent1ba4e37228e6eae0d09c0cca7f4ab7fb489fdc9d
Galaxies: prevent creation of empty undo-chain items.

If you drag an arrow on to a square which is already filled in as part
of a completed region, or whose counterpart is filled in, or whose
counterpart is actually a dot, then the game can't actually place a
double arrow. Previously, it didn't find that out until execute_move
time, at which point it was too late to prevent a no-op action from
being placed on the undo chain.

Now we do those checks in interpret_move, before generating the move
string that tries to place the double arrow in the first place. So
execute_move can now enforce by assertion that arrow-placement moves
it gets are valid.
galaxies.c