aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-08-09 15:58:34 +0100
committerBen Harris <bjh21@bjh21.me.uk>2023-08-09 15:58:34 +0100
commit503f1c4ab81928c2792a2cf73bc97587460dac86 (patch)
treee2ab999890d14254bfcc741f162584d5556921af
parente30d11ecd169c2e963fada4cac28123b4f4f9a7e (diff)
downloadpuzzles-503f1c4ab81928c2792a2cf73bc97587460dac86.zip
puzzles-503f1c4ab81928c2792a2cf73bc97587460dac86.tar.gz
puzzles-503f1c4ab81928c2792a2cf73bc97587460dac86.tar.bz2
puzzles-503f1c4ab81928c2792a2cf73bc97587460dac86.tar.xz
Distinguish MOVE_UNUSED from MOVE_NO_EFFECT in Light Up
Light Up is unusual in that clicking outside the grid hides the cursor, so the return value from clicks outside the grid is MOVE_NO_EFFECT or MOVE_UI_UPDATE rather than the more usual MOVE_UNUSED.
-rw-r--r--lightup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lightup.c b/lightup.c
index 31a3820..e779663 100644
--- a/lightup.c
+++ b/lightup.c
@@ -1954,7 +1954,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
enum { NONE, FLIP_LIGHT, FLIP_IMPOSSIBLE } action = NONE;
int cx = -1, cy = -1;
unsigned int flags;
- char buf[80], *nullret = MOVE_UI_UPDATE, *empty = MOVE_UI_UPDATE, c;
+ char buf[80], *nullret = MOVE_NO_EFFECT, *empty = MOVE_UI_UPDATE, c;
if (button == LEFT_BUTTON || button == RIGHT_BUTTON) {
if (ui->cur_visible)
@@ -1978,7 +1978,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
nullret = move_cursor(button, &ui->cur_x, &ui->cur_y,
state->w, state->h, false, &ui->cur_visible);
} else
- return NULL;
+ return MOVE_UNUSED;
switch (action) {
case FLIP_LIGHT: