aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2023-08-13 14:31:50 +0100
committerSimon Tatham <anakin@pobox.com>2023-08-13 14:36:30 +0100
commitdf31bc7a515a56b2322a097bda8f1aa510a7b9da (patch)
tree78ba2c1bd45834bc30f36c6bef4729344fdce225
parenta11ee53ef844522b48b06ddffed268fa86d7b2ec (diff)
downloadpuzzles-df31bc7a515a56b2322a097bda8f1aa510a7b9da.zip
puzzles-df31bc7a515a56b2322a097bda8f1aa510a7b9da.tar.gz
puzzles-df31bc7a515a56b2322a097bda8f1aa510a7b9da.tar.bz2
puzzles-df31bc7a515a56b2322a097bda8f1aa510a7b9da.tar.xz
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.
-rw-r--r--unfinished/group.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/unfinished/group.c b/unfinished/group.c
index c622e9a..943767f 100644
--- a/unfinished/group.c
+++ b/unfinished/group.c
@@ -1655,6 +1655,10 @@ static char *interpret_move(const game_state *state, game_ui *ui,
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 &&