chiark / gitweb /
Fix Bridges keyboard cursor vertical out-of-bounds error.
authorJonas Kölker <jonaskoelker@yahoo.com>
Mon, 5 Oct 2015 08:03:57 +0000 (10:03 +0200)
committerSimon Tatham <anakin@pobox.com>
Sun, 18 Oct 2015 10:01:51 +0000 (11:01 +0100)
Position the cursor in the top (bottom) row, press enter and press up
(down).  The game acts as if you had pressed right, both with Enter-
and Space-based dragging.

bridges.c

index 23a95f58cc7a7c7f457ef3926e10f9dff230aba0..eb15437fb427bff7c95fe698da28bc112a4bb8e6 100644 (file)
--- a/bridges.c
+++ b/bridges.c
@@ -2376,6 +2376,8 @@ static char *interpret_move(const game_state *state, game_ui *ui,
             int nx = ui->cur_x, ny = ui->cur_y;
 
             move_cursor(button, &nx, &ny, state->w, state->h, 0);
+            if (nx == ui->cur_x && ny == ui->cur_y)
+                return NULL;
             update_drag_dst(state, ui, ds,
                              COORD(nx)+TILE_SIZE/2,
                              COORD(ny)+TILE_SIZE/2);