shithub: puzzles

Download patch

ref: 75335f199ea5fbc7b1af890473ec98dc340c2ae8
parent: fcf573c672b0aa862ccc087a74256ee214c277b5
author: Jonas Kölker <jonaskoelker@yahoo.com>
date: Mon Oct 5 06:03:57 EDT 2015

Fix Bridges keyboard cursor vertical out-of-bounds error.

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.

--- a/bridges.c
+++ b/bridges.c
@@ -2376,6 +2376,8 @@
             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);