diff --git a/galaxies.c b/galaxies.c index 9a7b363..908b45a 100644 --- a/galaxies.c +++ b/galaxies.c @@ -353,6 +353,8 @@ static bool ok_to_add_assoc_with_opposite_internal( int *colors; bool toret; + if (tile->type != s_tile) + return false; if (tile->flags & F_DOT) return false; if (opposite == NULL) @@ -2645,14 +2647,14 @@ static char *interpret_move(const game_state *state, game_ui *ui, ui->dy = y; return UI_UPDATE; } else if (button == RIGHT_RELEASE && ui->dragging) { - ui->dragging = false; - /* * Drags are always targeted at a single square. */ px = 2*FROMCOORD(x+TILE_SIZE) - 1; py = 2*FROMCOORD(y+TILE_SIZE) - 1; + dropped: /* We arrive here from the end of a keyboard drag. */ + ui->dragging = false; /* * Dragging an arrow on to the same square it started from * is a null move; just update the ui and finish. @@ -2710,18 +2712,8 @@ static char *interpret_move(const game_state *state, game_ui *ui, } sp = &SPACE(state, ui->cur_x, ui->cur_y); if (ui->dragging) { - ui->dragging = false; - - if ((ui->srcx != ui->dotx || ui->srcy != ui->doty) && - SPACE(state, ui->srcx, ui->srcy).flags & F_TILE_ASSOC) { - sprintf(buf, "%sU%d,%d", sep, ui->srcx, ui->srcy); - sep = ";"; - } - if (sp->type == s_tile && !(sp->flags & F_DOT) && !(sp->flags & F_TILE_ASSOC)) { - sprintf(buf + strlen(buf), "%sA%d,%d,%d,%d", - sep, ui->cur_x, ui->cur_y, ui->dotx, ui->doty); - } - return dupstr(buf); + px = ui->cur_x; py = ui->cur_y; + goto dropped; } else if (sp->flags & F_DOT) { ui->dragging = true; ui->dx = SCOORD(ui->cur_x);