aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-06-11 20:13:10 +0100
committerBen Harris <bjh21@bjh21.me.uk>2023-06-11 20:13:10 +0100
commit1a316f47ad3d1749b9b31a99cdb1ebf472fe1d85 (patch)
treee5ff2f5724e23403b32b128f5962bc269b1ba1c2
parent19b3bfc0d387424d6318027a1c3ff4b3ac532f19 (diff)
downloadpuzzles-1a316f47ad3d1749b9b31a99cdb1ebf472fe1d85.zip
puzzles-1a316f47ad3d1749b9b31a99cdb1ebf472fe1d85.tar.gz
puzzles-1a316f47ad3d1749b9b31a99cdb1ebf472fe1d85.tar.bz2
puzzles-1a316f47ad3d1749b9b31a99cdb1ebf472fe1d85.tar.xz
Distinguish MOVE_UNUSED from MOVE_NO_EFFECT in Bridges
-rw-r--r--bridges.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/bridges.c b/bridges.c
index 7997c69..e825e65 100644
--- a/bridges.c
+++ b/bridges.c
@@ -2371,7 +2371,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
button &= ~MOD_MASK;
if (button == LEFT_BUTTON || button == RIGHT_BUTTON) {
- if (!INGRID(state, gx, gy)) return NULL;
+ if (!INGRID(state, gx, gy)) return MOVE_UNUSED;
ui->cur_visible = false;
if (ggrid & G_ISLAND) {
ui->dragx_src = gx;
@@ -2401,8 +2401,8 @@ static char *interpret_move(const game_state *state, game_ui *ui,
return ui_cancel_drag(ui);
}
ui_cancel_drag(ui);
- if (!INGRID(state, gx, gy)) return NULL;
- if (!(GRID(state, gx, gy) & G_ISLAND)) return NULL;
+ if (!INGRID(state, gx, gy)) return MOVE_UNUSED;
+ if (!(GRID(state, gx, gy) & G_ISLAND)) return MOVE_NO_EFFECT;
sprintf(buf, "M%d,%d", gx, gy);
return dupstr(buf);
}
@@ -2425,7 +2425,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
move_cursor(button, &nx, &ny, state->w, state->h, false);
if (nx == ui->cur_x && ny == ui->cur_y)
- return NULL;
+ return MOVE_NO_EFFECT;
update_drag_dst(state, ui, ds,
COORD(nx)+TILE_SIZE/2,
COORD(ny)+TILE_SIZE/2);
@@ -2553,13 +2553,13 @@ found:
ui->cur_y = best_y;
return MOVE_UI_UPDATE;
} else
- return NULL;
+ return MOVE_NO_EFFECT;
} else if (button == 'g' || button == 'G') {
ui->show_hints = !ui->show_hints;
return MOVE_UI_UPDATE;
}
- return NULL;
+ return MOVE_UNUSED;
}
static game_state *execute_move(const game_state *state, const char *move)