shithub: puzzles

Download patch

ref: df31bc7a515a56b2322a097bda8f1aa510a7b9da
parent: a11ee53ef844522b48b06ddffed268fa86d7b2ec
author: Simon Tatham <anakin@pobox.com>
date: Sun Aug 13 10:31:50 EDT 2023

Group: make keyboard play work again.

It looks as if it's been broken for about nine years, ever since
commit 822243de1bc1fc6d introduced the system for drag-selecting a
diagonal of squares. The effect of moving the keyboard cursor and then
pressing a button was to cause crashes because the ui fields
introduced for that system to use (ohx, ohy, odx, ody, odn) were all
completely uninitialised.

--- a/unfinished/group.c
+++ b/unfinished/group.c
@@ -1655,6 +1655,10 @@
         ui->hy = state->sequence[cy];
         ui->hshow = true;
         ui->hcursor = true;
+        ui->ohx = cx;
+        ui->ohy = cy;
+        ui->odx = ui->ody = 0;
+        ui->odn = 1;
         return MOVE_UI_UPDATE;
     }
     if (ui->hshow &&