X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/5d6421f7727fb367981ad5a1dfba5e17207e1e4e..1a07a34dc03de7220c8924cd05ea47201de9ab55:/towers.c diff --git a/towers.c b/towers.c index f06f2ad..c3372a3 100644 --- a/towers.c +++ b/towers.c @@ -1290,10 +1290,11 @@ static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds, (x - ox >= 0 && x - ox < TILESIZE && y - oy >= 0 && y - oy < TILESIZE) || /* in triangle between top-left corners? */ - (ox > bx && x >= bx && x <= ox && + (ox > bx && x >= bx && x <= ox && y <= by && (by-y) * (ox-bx) <= (by-oy) * (x-bx)) || /* in triangle between bottom-right corners? */ (ox > bx && x >= bx+TILESIZE && x <= ox+TILESIZE && + y >= oy+TILESIZE && (by-y+TILESIZE)*(ox-bx) >= (by-oy)*(x-bx-TILESIZE))) { tx = cx; ty = cy;