shithub: puzzles

Download patch

ref: 02cd67ecb676cb1296d29630483e786f4f0303f6
parent: 67b37596c2d01b993d540aceaffa936606755f5b
author: Jacob Nevins <jacobn@chiark.greenend.org.uk>
date: Fri Mar 16 09:32:43 EDT 2007

Disallow clicks between squares.

[originally from svn r7400]

--- a/unequal.c
+++ b/unequal.c
@@ -1266,7 +1266,8 @@
 
     button &= ~MOD_MASK;
 
-    if (x >= 0 && x < ds->order && y >= 0 && y < ds->order) {
+    if (x >= 0 && x < ds->order && ((ox - COORD(x)) <= TILE_SIZE) &&
+        y >= 0 && y < ds->order && ((oy - COORD(y)) <= TILE_SIZE)) {
         if (button == LEFT_BUTTON) {
             /* normal highlighting for non-immutable squares */
             if (GRID(state, flags, x, y) & F_IMMUTABLE)