Fix problems with arrow UI with non-square grid.
authorjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Fri, 2 Mar 2007 20:14:15 +0000 (20:14 +0000)
committerjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Fri, 2 Mar 2007 20:14:15 +0000 (20:14 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@7355 cda61777-01e9-0310-a592-d414129be87e

galaxies.c

index 8ac8399..eb00a72 100644 (file)
@@ -2517,7 +2517,7 @@ static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
         for (py1 = py-1; py1 <= py+1; py1++)
             for (px1 = px-1; px1 <= px+1; px1++) {
                 if (px1 >= 0 && px1 < state->sx &&
-                    py1 >= 0 && py1 < state->sx &&
+                    py1 >= 0 && py1 < state->sy &&
                     x >= SCOORD(px1-1) && x < SCOORD(px1+1) &&
                     y >= SCOORD(py1-1) && y < SCOORD(py1+1) &&
                     SPACE(state, px1, py1).flags & F_DOT) {
@@ -2538,7 +2538,7 @@ static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
         if (!dot) {
             px = 2*FROMCOORD(x+TILE_SIZE) - 1;
             py = 2*FROMCOORD(y+TILE_SIZE) - 1;
-            if (px >= 0 && px < state->sx && py >= 0 && py < state->sx) {
+            if (px >= 0 && px < state->sx && py >= 0 && py < state->sy) {
                 sp = &SPACE(state, px, py);
                 if (sp->flags & F_TILE_ASSOC) {
                     dot = &SPACE(state, sp->dotx, sp->doty);