aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Nevins <jacobn@chiark.greenend.org.uk>2007-03-02 20:14:15 +0000
committerJacob Nevins <jacobn@chiark.greenend.org.uk>2007-03-02 20:14:15 +0000
commit6713d21cd19d007b6810e6bccf379680fd9a5b3b (patch)
tree22cf043b6df0161cdc22262ef10e981c76d8c132
parent3584fc5a1bd8d613e32362ec3a89dd28f4d5c267 (diff)
downloadpuzzles-6713d21cd19d007b6810e6bccf379680fd9a5b3b.zip
puzzles-6713d21cd19d007b6810e6bccf379680fd9a5b3b.tar.gz
puzzles-6713d21cd19d007b6810e6bccf379680fd9a5b3b.tar.bz2
puzzles-6713d21cd19d007b6810e6bccf379680fd9a5b3b.tar.xz
Fix problems with arrow UI with non-square grid.
[originally from svn r7355]
-rw-r--r--galaxies.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/galaxies.c b/galaxies.c
index 8ac8399..eb00a72 100644
--- a/galaxies.c
+++ b/galaxies.c
@@ -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);