aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Lyles <kevinlyles@gmail.com>2015-05-09 19:11:02 -0500
committerSimon Tatham <anakin@pobox.com>2015-05-11 11:05:36 +0100
commit3627111c5210a5b134b0e8c43b90eed07ca2e17c (patch)
tree03fa84fd39c5b3e942c8c3db3cd58356cf8ac568
parentbef1b2c59b443a2778a01e6c167e29ee9670603a (diff)
downloadpuzzles-3627111c5210a5b134b0e8c43b90eed07ca2e17c.zip
puzzles-3627111c5210a5b134b0e8c43b90eed07ca2e17c.tar.gz
puzzles-3627111c5210a5b134b0e8c43b90eed07ca2e17c.tar.bz2
puzzles-3627111c5210a5b134b0e8c43b90eed07ca2e17c.tar.xz
Fix the extra arrow hanging around while moving the opposite existing arrow
-rw-r--r--galaxies.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/galaxies.c b/galaxies.c
index f276265..330b6bb 100644
--- a/galaxies.c
+++ b/galaxies.c
@@ -3263,7 +3263,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
for (x = 0; x < w; x++) {
unsigned long flags = 0;
int ddx = 0, ddy = 0;
- space *sp;
+ space *sp, *opp;
int dx, dy;
/*
@@ -3301,6 +3301,11 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
* everything goes briefly back to background colour.
*/
sp = &SPACE(state, x*2+1, y*2+1);
+ if (sp->flags & F_TILE_ASSOC) {
+ opp = tile_opposite(state, sp);
+ } else {
+ opp = NULL;
+ }
if (ds->colour_scratch[y*w+x] && !flashing) {
flags |= (ds->colour_scratch[y*w+x] == 2 ?
DRAW_BLACK : DRAW_WHITE);
@@ -3316,7 +3321,9 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
*/
if ((sp->flags & F_TILE_ASSOC) && !ds->colour_scratch[y*w+x]) {
if (ui->dragging && ui->srcx == x*2+1 && ui->srcy == y*2+1) {
- /* don't do it */
+ /* tile is the source, don't do it */
+ } else if (ui->dragging && opp && ui->srcx == opp->x && ui->srcy == opp->y) {
+ /* opposite tile is the source, don't do it */
} else if (sp->doty != y*2+1 || sp->dotx != x*2+1) {
flags |= DRAW_ARROW;
ddy = sp->doty - (y*2+1);